@@ -17,6 +17,16 @@ class StatBatch extends Batch<IStats, { path: fs.PathLike }> {
17
17
}
18
18
}
19
19
20
+ class LstatBatch extends Batch < IStats , { path : fs . PathLike } > {
21
+ public constructor ( private readonly proxy : FsModuleProxy ) {
22
+ super ( ) ;
23
+ }
24
+
25
+ protected remoteCall ( batch : { path : fs . PathLike } [ ] ) : Promise < ( IStats | Error ) [ ] > {
26
+ return this . proxy . lstatBatch ( batch ) ;
27
+ }
28
+ }
29
+
20
30
class ReaddirBatch extends Batch < Buffer [ ] | fs . Dirent [ ] | string [ ] , { path : fs . PathLike , options : IEncodingOptions } > {
21
31
public constructor ( private readonly proxy : FsModuleProxy ) {
22
32
super ( ) ;
@@ -49,10 +59,12 @@ class WriteStream extends Writable<WriteStreamProxy> implements fs.WriteStream {
49
59
50
60
export class FsModule {
51
61
private readonly statBatch : StatBatch ;
62
+ private readonly lstatBatch : LstatBatch ;
52
63
private readonly readdirBatch : ReaddirBatch ;
53
64
54
65
public constructor ( private readonly proxy : FsModuleProxy ) {
55
66
this . statBatch = new StatBatch ( this . proxy ) ;
67
+ this . lstatBatch = new LstatBatch ( this . proxy ) ;
56
68
this . readdirBatch = new ReaddirBatch ( this . proxy ) ;
57
69
}
58
70
@@ -148,7 +160,7 @@ export class FsModule {
148
160
}
149
161
150
162
public lstat = ( path : fs . PathLike , callback : ( err : NodeJS . ErrnoException , stats : fs . Stats ) => void ) : void => {
151
- callbackify ( this . proxy . lstat ) ( path , ( error , stats ) => {
163
+ callbackify ( this . lstatBatch . add ) ( { path } , ( error , stats ) => {
152
164
callback ( error , stats && new Stats ( stats ) ) ;
153
165
} ) ;
154
166
}
0 commit comments