Skip to content

Commit 262f2cb

Browse files
anonrigaduh95
authored andcommitted
esm: remove unnecessary toNamespacedPath calls
PR-URL: #53656 Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent cbe77b3 commit 262f2cb

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lib/internal/modules/esm/resolve.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ const { BuiltinModule } = require('internal/bootstrap/realm');
2727
const { realpathSync } = require('fs');
2828
const { getOptionValue } = require('internal/options');
2929
// Do not eagerly grab .manifest, it may be in TDZ
30-
const { sep, posix: { relative: relativePosixPath }, toNamespacedPath, resolve } = require('path');
30+
const { sep, posix: { relative: relativePosixPath }, resolve } = require('path');
3131
const preserveSymlinks = getOptionValue('--preserve-symlinks');
3232
const preserveSymlinksMain = getOptionValue('--preserve-symlinks-main');
3333
const experimentalNetworkImports =
@@ -246,8 +246,8 @@ function finalizeResolution(resolved, base, preserveSymlinks) {
246246
throw err;
247247
}
248248

249-
const stats = internalFsBinding.internalModuleStat(toNamespacedPath(StringPrototypeEndsWith(path, '/') ?
250-
StringPrototypeSlice(path, -1) : path));
249+
const stats = internalFsBinding.internalModuleStat(StringPrototypeEndsWith(path, '/') ?
250+
StringPrototypeSlice(path, -1) : path);
251251

252252
// Check for stats.isDirectory()
253253
if (stats === 1) {
@@ -807,7 +807,7 @@ function packageResolve(specifier, base, conditions) {
807807
let lastPath;
808808
do {
809809
const stat = internalFsBinding.internalModuleStat(
810-
toNamespacedPath(StringPrototypeSlice(packageJSONPath, 0, packageJSONPath.length - 13)),
810+
StringPrototypeSlice(packageJSONPath, 0, packageJSONPath.length - 13),
811811
);
812812
// Check for !stat.isDirectory()
813813
if (stat !== 1) {

0 commit comments

Comments
 (0)