path: fix toNamespacedPath on Windows
PR-URL: https://github.com/nodejs/node/pull/52915 Fixes: https://github.com/nodejs/node/issues/30224 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
This commit is contained in:
parent
29884d1d5c
commit
dcd8b82e15
@ -647,7 +647,7 @@ const win32 = {
|
||||
return `\\\\?\\${resolvedPath}`;
|
||||
}
|
||||
|
||||
return path;
|
||||
return resolvedPath;
|
||||
},
|
||||
|
||||
/**
|
||||
|
@ -79,7 +79,8 @@ assert.strictEqual(path.win32.toNamespacedPath('\\\\foo\\bar'),
|
||||
'\\\\?\\UNC\\foo\\bar\\');
|
||||
assert.strictEqual(path.win32.toNamespacedPath('//foo//bar'),
|
||||
'\\\\?\\UNC\\foo\\bar\\');
|
||||
assert.strictEqual(path.win32.toNamespacedPath('\\\\?\\foo'), '\\\\?\\foo');
|
||||
assert.strictEqual(path.win32.toNamespacedPath('\\\\?\\foo'), '\\\\?\\foo\\');
|
||||
assert.strictEqual(path.win32.toNamespacedPath('\\\\?\\c:\\Windows/System'), '\\\\?\\c:\\Windows\\System');
|
||||
assert.strictEqual(path.win32.toNamespacedPath(null), null);
|
||||
assert.strictEqual(path.win32.toNamespacedPath(true), true);
|
||||
assert.strictEqual(path.win32.toNamespacedPath(1), 1);
|
||||
|
Loading…
x
Reference in New Issue
Block a user