@@ -64,6 +64,7 @@ export namespace FileTime {
6464 )
6565
6666 const getLock = Effect . fn ( "FileTime.lock" ) ( function * ( filepath : string ) {
67+ filepath = Filesystem . normalizePath ( filepath )
6768 const locks = ( yield * InstanceState . get ( state ) ) . locks
6869 const lock = locks . get ( filepath )
6970 if ( lock ) return lock
@@ -74,18 +75,21 @@ export namespace FileTime {
7475 } )
7576
7677 const read = Effect . fn ( "FileTime.read" ) ( function * ( sessionID : SessionID , file : string ) {
78+ file = Filesystem . normalizePath ( file )
7779 const reads = ( yield * InstanceState . get ( state ) ) . reads
7880 log . info ( "read" , { sessionID, file } )
7981 session ( reads , sessionID ) . set ( file , yield * stamp ( file ) )
8082 } )
8183
8284 const get = Effect . fn ( "FileTime.get" ) ( function * ( sessionID : SessionID , file : string ) {
85+ file = Filesystem . normalizePath ( file )
8386 const reads = ( yield * InstanceState . get ( state ) ) . reads
8487 return reads . get ( sessionID ) ?. get ( file ) ?. read
8588 } )
8689
8790 const assert = Effect . fn ( "FileTime.assert" ) ( function * ( sessionID : SessionID , filepath : string ) {
8891 if ( disableCheck ) return
92+ filepath = Filesystem . normalizePath ( filepath )
8993
9094 const reads = ( yield * InstanceState . get ( state ) ) . reads
9195 const time = reads . get ( sessionID ) ?. get ( filepath )
@@ -101,6 +105,7 @@ export namespace FileTime {
101105 } )
102106
103107 const withLock = Effect . fn ( "FileTime.withLock" ) ( function * < T > ( filepath : string , fn : ( ) => Promise < T > ) {
108+ filepath = Filesystem . normalizePath ( filepath )
104109 return yield * Effect . promise ( fn ) . pipe ( ( yield * getLock ( filepath ) ) . withPermits ( 1 ) )
105110 } )
106111
0 commit comments