99 StringPrototypeStartsWith,
1010} = primordials ;
1111
12- const { dirname, isAbsolute, resolve } = require ( 'path' ) ;
13- const { normalizePath } = require ( 'internal/vfs/router' ) ;
12+ const { dirname, isAbsolute, normalize, resolve } = require ( 'path' ) ;
1413const { isURL, pathToFileURL, fileURLToPath, toPathIfFileURL, URL } = require ( 'internal/url' ) ;
1514const { kEmptyObject } = require ( 'internal/util' ) ;
1615const { validateObject } = require ( 'internal/validators' ) ;
@@ -80,7 +79,7 @@ function unregisterVFS(vfs) {
8079 * @returns {{ vfs: VirtualFileSystem, result: number }|null }
8180 */
8281function findVFSForStat ( filename ) {
83- const normalized = normalizePath ( filename ) ;
82+ const normalized = normalize ( filename ) ;
8483 for ( let i = 0 ; i < activeVFSList . length ; i ++ ) {
8584 const vfs = activeVFSList [ i ] ;
8685 if ( vfs . shouldHandle ( normalized ) ) {
@@ -102,7 +101,7 @@ function findVFSForStat(filename) {
102101 * @returns {{ vfs: VirtualFileSystem, content: Buffer|string }|null }
103102 */
104103function findVFSForRead ( filename , options ) {
105- const normalized = normalizePath ( filename ) ;
104+ const normalized = normalize ( filename ) ;
106105 for ( let i = 0 ; i < activeVFSList . length ; i ++ ) {
107106 const vfs = activeVFSList [ i ] ;
108107 if ( vfs . shouldHandle ( normalized ) ) {
@@ -141,7 +140,7 @@ function findVFSForRead(filename, options) {
141140 * @returns {{ vfs: VirtualFileSystem, exists: boolean }|null }
142141 */
143142function findVFSForExists ( filename ) {
144- const normalized = normalizePath ( filename ) ;
143+ const normalized = normalize ( filename ) ;
145144 for ( let i = 0 ; i < activeVFSList . length ; i ++ ) {
146145 const vfs = activeVFSList [ i ] ;
147146 if ( vfs . shouldHandle ( normalized ) ) {
@@ -162,7 +161,7 @@ function findVFSForExists(filename) {
162161 * @returns {{ vfs: VirtualFileSystem, realpath: string }|null }
163162 */
164163function findVFSForRealpath ( filename ) {
165- const normalized = normalizePath ( filename ) ;
164+ const normalized = normalize ( filename ) ;
166165 for ( let i = 0 ; i < activeVFSList . length ; i ++ ) {
167166 const vfs = activeVFSList [ i ] ;
168167 if ( vfs . shouldHandle ( normalized ) ) {
@@ -189,7 +188,7 @@ function findVFSForRealpath(filename) {
189188 * @returns {{ vfs: VirtualFileSystem, stats: Stats }|null }
190189 */
191190function findVFSForFsStat ( filename ) {
192- const normalized = normalizePath ( filename ) ;
191+ const normalized = normalize ( filename ) ;
193192 for ( let i = 0 ; i < activeVFSList . length ; i ++ ) {
194193 const vfs = activeVFSList [ i ] ;
195194 if ( vfs . shouldHandle ( normalized ) ) {
@@ -217,7 +216,7 @@ function findVFSForFsStat(filename) {
217216 * @returns {{ vfs: VirtualFileSystem, entries: string[]|Dirent[] }|null }
218217 */
219218function findVFSForReaddir ( dirname , options ) {
220- const normalized = normalizePath ( dirname ) ;
219+ const normalized = normalize ( dirname ) ;
221220 for ( let i = 0 ; i < activeVFSList . length ; i ++ ) {
222221 const vfs = activeVFSList [ i ] ;
223222 if ( vfs . shouldHandle ( normalized ) ) {
@@ -245,7 +244,7 @@ function findVFSForReaddir(dirname, options) {
245244 * @returns {Promise<{ vfs: VirtualFileSystem, entries: string[]|Dirent[] }|null> }
246245 */
247246async function findVFSForReaddirAsync ( dirname , options ) {
248- const normalized = normalizePath ( dirname ) ;
247+ const normalized = normalize ( dirname ) ;
249248 for ( let i = 0 ; i < activeVFSList . length ; i ++ ) {
250249 const vfs = activeVFSList [ i ] ;
251250 if ( vfs . shouldHandle ( normalized ) ) {
@@ -272,7 +271,7 @@ async function findVFSForReaddirAsync(dirname, options) {
272271 * @returns {Promise<{ vfs: VirtualFileSystem, stats: Stats }|null> }
273272 */
274273async function findVFSForLstatAsync ( filename ) {
275- const normalized = normalizePath ( filename ) ;
274+ const normalized = normalize ( filename ) ;
276275 for ( let i = 0 ; i < activeVFSList . length ; i ++ ) {
277276 const vfs = activeVFSList [ i ] ;
278277 if ( vfs . shouldHandle ( normalized ) ) {
@@ -300,7 +299,7 @@ async function findVFSForLstatAsync(filename) {
300299 * @returns {{ vfs: VirtualFileSystem }|null }
301300 */
302301function findVFSForWatch ( filename ) {
303- const normalized = normalizePath ( filename ) ;
302+ const normalized = normalize ( filename ) ;
304303 for ( let i = 0 ; i < activeVFSList . length ; i ++ ) {
305304 const vfs = activeVFSList [ i ] ;
306305 if ( vfs . shouldHandle ( normalized ) ) {
@@ -387,7 +386,7 @@ function vfsResolveHook(specifier, context, nextResolve) {
387386 }
388387
389388 // Check if any VFS handles this path
390- const normalized = normalizePath ( checkPath ) ;
389+ const normalized = normalize ( checkPath ) ;
391390 for ( let i = 0 ; i < activeVFSList . length ; i ++ ) {
392391 const vfs = activeVFSList [ i ] ;
393392 if ( vfs . shouldHandle ( normalized ) && vfs . existsSync ( normalized ) ) {
@@ -431,7 +430,7 @@ function vfsLoadHook(url, context, nextLoad) {
431430 }
432431
433432 const filePath = fileURLToPath ( url ) ;
434- const normalized = normalizePath ( filePath ) ;
433+ const normalized = normalize ( filePath ) ;
435434
436435 // Check if any VFS handles this path
437436 for ( let i = 0 ; i < activeVFSList . length ; i ++ ) {
0 commit comments