@@ -65,17 +65,17 @@ export class Union {
65
65
}
66
66
67
67
for ( let method of SPECIAL_METHODS . values ( ) ) {
68
- // bind special methods to support
68
+ // bind special methods to support
69
69
// const { method } = ufs;
70
70
this [ method ] = this [ method ] . bind ( this ) ;
71
71
}
72
72
}
73
73
74
- public unwatchFile ( ...args ) {
74
+ public unwatchFile = ( ...args ) => {
75
75
throw new Error ( "unwatchFile is not supported, please use watchFile" ) ;
76
76
}
77
77
78
- public watch ( ...args ) {
78
+ public watch = ( ...args ) => {
79
79
const watchers = [ ] ;
80
80
for ( const fs of this . fss ) {
81
81
try {
@@ -86,11 +86,11 @@ export class Union {
86
86
}
87
87
}
88
88
89
- // return a proxy to call functions on these props
89
+ // return a proxy to call functions on these props
90
90
return createFSProxy ( watchers ) ;
91
91
}
92
92
93
- public watchFile ( ...args ) {
93
+ public watchFile = ( ...args ) => {
94
94
const watchers = [ ] ;
95
95
for ( const fs of this . fss ) {
96
96
try {
@@ -101,11 +101,11 @@ export class Union {
101
101
}
102
102
}
103
103
104
- // return a proxy to call functions on these props
104
+ // return a proxy to call functions on these props
105
105
return createFSProxy ( watchers ) ;
106
106
}
107
107
108
- public existsSync ( path : string ) {
108
+ public existsSync = ( path : string ) => {
109
109
for ( const fs of this . fss ) {
110
110
try {
111
111
if ( fs . existsSync ( path ) ) {
@@ -119,7 +119,7 @@ export class Union {
119
119
return false ;
120
120
} ;
121
121
122
- public readdir ( ...args ) {
122
+ public readdir = ( ...args ) => {
123
123
let lastarg = args . length - 1 ;
124
124
let cb = args [ lastarg ] ;
125
125
if ( typeof cb !== 'function' ) {
@@ -150,7 +150,7 @@ export class Union {
150
150
}
151
151
if ( resArg ) {
152
152
result = result !== null ? result : new Set ( ) ;
153
-
153
+
154
154
// Convert all results to Strings to make sure that they're deduped
155
155
for ( const res of resArg ) {
156
156
result . add ( String ( res ) ) ;
@@ -174,7 +174,7 @@ export class Union {
174
174
iterate ( ) ;
175
175
} ;
176
176
177
- public readdirSync ( ...args ) {
177
+ public readdirSync = ( ...args ) => {
178
178
let lastError : IUnionFsError = null ;
179
179
let result = new Set < string > ( ) ;
180
180
for ( let i = this . fss . length - 1 ; i >= 0 ; i -- ) {
@@ -199,7 +199,7 @@ export class Union {
199
199
return Array . from ( result ) . sort ( ) ;
200
200
} ;
201
201
202
- public createReadStream ( path : string ) {
202
+ public createReadStream = ( path : string ) => {
203
203
let lastError = null ;
204
204
for ( const fs of this . fss ) {
205
205
try {
@@ -225,7 +225,7 @@ export class Union {
225
225
throw lastError ;
226
226
}
227
227
228
- public createWriteStream ( path : string ) {
228
+ public createWriteStream = ( path : string ) => {
229
229
let lastError = null ;
230
230
for ( const fs of this . fss ) {
231
231
try {
@@ -251,9 +251,9 @@ export class Union {
251
251
252
252
/**
253
253
* Adds a filesystem to the list of filesystems in the union
254
- * The new filesystem object is added as the last filesystem used
255
- * when searching for a file.
256
- *
254
+ * The new filesystem object is added as the last filesystem used
255
+ * when searching for a file.
256
+ *
257
257
* @param fs the filesystem interface to be added to the queue of FS's
258
258
* @returns this instance of a unionFS
259
259
*/
0 commit comments