@@ -24,38 +24,39 @@ let getRelativePath (pathFrom: string) (pathTo: string) =
2424
2525open Fable.Core .JsInterop
2626
27- type private IFileSystem =
28- abstract readFileSync: string -> byte []
29- abstract readFileSync: string * string -> string
30- abstract writeFileSync: string * string -> unit
27+ module JS =
28+ type IFileSystem =
29+ abstract readFileSync: string -> byte []
30+ abstract readFileSync: string * string -> string
31+ abstract writeFileSync: string * string -> unit
3132
32- type private IProcess =
33- abstract hrtime: unit -> float []
34- abstract hrtime: float [] -> float []
33+ type IProcess =
34+ abstract hrtime: unit -> float []
35+ abstract hrtime: float [] -> float []
3536
36- type private IPath =
37- abstract resolve: string -> string
38- abstract relative: string * string -> string
37+ type IPath =
38+ abstract resolve: string -> string
39+ abstract relative: string * string -> string
3940
40- let private FileSystem : IFileSystem = importAll " fs"
41- let private Process : IProcess = importAll " process"
42- let private Path : IPath = importAll " path"
41+ let FileSystem : IFileSystem = importAll " fs"
42+ let Process : IProcess = importAll " process"
43+ let Path : IPath = importAll " path"
4344
44- let readAllBytes ( filePath : string ) = FileSystem.readFileSync( filePath)
45- let readAllText ( filePath : string ) = FileSystem.readFileSync( filePath, " utf8" ) .TrimStart( '\uFEFF')
46- let writeAllText ( filePath : string ) ( text : string ) = FileSystem.writeFileSync( filePath, text)
45+ let readAllBytes ( filePath : string ) = JS. FileSystem.readFileSync( filePath)
46+ let readAllText ( filePath : string ) = JS. FileSystem.readFileSync( filePath, " utf8" ) .TrimStart( '\uFEFF')
47+ let writeAllText ( filePath : string ) ( text : string ) = JS. FileSystem.writeFileSync( filePath, text)
4748
4849let measureTime ( f : 'a -> 'b ) x =
49- let startTime = Process.hrtime()
50+ let startTime = JS. Process.hrtime()
5051 let res = f x
51- let elapsed = Process.hrtime( startTime)
52+ let elapsed = JS. Process.hrtime( startTime)
5253 int64 ( elapsed.[ 0 ] * 1e3 + elapsed.[ 1 ] / 1e6 ), res
5354
5455let normalizeFullPath ( path : string ) =
55- Path.resolve( path) .Replace( '\\' , '/' )
56+ JS. Path.resolve( path) .Replace( '\\' , '/' )
5657
5758let getRelativePath ( pathFrom : string ) ( pathTo : string ) =
58- Path.relative( pathFrom, pathTo) .Replace( '\\' , '/' )
59+ JS. Path.relative( pathFrom, pathTo) .Replace( '\\' , '/' )
5960
6061#endif
6162
0 commit comments