@@ -76,9 +76,6 @@ export class OverlayFs implements IFileSystem {
7676 private readonly readOnly : boolean ;
7777 private readonly memory : Map < string , MemoryEntry > = new Map ( ) ;
7878 private readonly deleted : Set < string > = new Set ( ) ;
79- // Cache stat results from real filesystem (files don't change during operation)
80- private readonly statCache : Map < string , FsStat > = new Map ( ) ;
81- private readonly lstatCache : Map < string , FsStat > = new Map ( ) ;
8279
8380 constructor ( options : OverlayFsOptions ) {
8481 // Resolve to absolute path
@@ -496,25 +493,16 @@ export class OverlayFs implements IFileSystem {
496493 throw new Error ( `ENOENT: no such file or directory, stat '${ path } '` ) ;
497494 }
498495
499- // Check stat cache first (files on disk don't change during operation)
500- const cached = this . statCache . get ( realPath ) ;
501- if ( cached ) {
502- return cached ;
503- }
504-
505496 try {
506497 const stat = await fs . promises . stat ( realPath ) ;
507- const result : FsStat = {
498+ return {
508499 isFile : stat . isFile ( ) ,
509500 isDirectory : stat . isDirectory ( ) ,
510501 isSymbolicLink : false ,
511502 mode : stat . mode ,
512503 size : stat . size ,
513504 mtime : stat . mtime ,
514505 } ;
515- // Cache the result
516- this . statCache . set ( realPath , result ) ;
517- return result ;
518506 } catch ( e ) {
519507 if ( ( e as NodeJS . ErrnoException ) . code === "ENOENT" ) {
520508 throw new Error ( `ENOENT: no such file or directory, stat '${ path } '` ) ;
@@ -565,25 +553,16 @@ export class OverlayFs implements IFileSystem {
565553 throw new Error ( `ENOENT: no such file or directory, lstat '${ path } '` ) ;
566554 }
567555
568- // Check lstat cache first
569- const cached = this . lstatCache . get ( realPath ) ;
570- if ( cached ) {
571- return cached ;
572- }
573-
574556 try {
575557 const stat = await fs . promises . lstat ( realPath ) ;
576- const result : FsStat = {
558+ return {
577559 isFile : stat . isFile ( ) ,
578560 isDirectory : stat . isDirectory ( ) ,
579561 isSymbolicLink : stat . isSymbolicLink ( ) ,
580562 mode : stat . mode ,
581563 size : stat . size ,
582564 mtime : stat . mtime ,
583565 } ;
584- // Cache the result
585- this . lstatCache . set ( realPath , result ) ;
586- return result ;
587566 } catch ( e ) {
588567 if ( ( e as NodeJS . ErrnoException ) . code === "ENOENT" ) {
589568 throw new Error ( `ENOENT: no such file or directory, lstat '${ path } '` ) ;
0 commit comments