@@ -149,11 +149,11 @@ const createRequestFactory = findMountpoint => (getter, method, readOnly, respon
149
149
const { attributes} = found . mount ;
150
150
const strict = attributes . strictGroups !== false ;
151
151
const ranges = ( ! attributes . adapter || attributes . adapter === 'system' ) || attributes . ranges === true ;
152
- const wrapper = m => found . adapter [ m ] ( { adapter : found . adapter , mount : found . mount } ) ( ...args ) ;
153
- const readstat = ( ) => wrapper ( 'stat' ) . catch ( ( ) => ( { } ) ) ;
152
+ const vfsMethodWrapper = m => found . adapter [ m ] ( found ) ( ...args ) ;
153
+ const readstat = ( ) => vfsMethodWrapper ( 'stat' ) . catch ( ( ) => ( { } ) ) ;
154
154
await checkMountpointPermission ( req , res , method , readOnly , strict ) ( found ) ;
155
155
156
- const result = await wrapper ( method ) ;
156
+ const result = await vfsMethodWrapper ( method ) ;
157
157
if ( method === 'readfile' ) {
158
158
const stat = await readstat ( ) ;
159
159
@@ -195,7 +195,6 @@ const createCrossRequestFactory = findMountpoint => (getter, method, respond) =>
195
195
const srcMount = await findMountpoint ( from ) ;
196
196
const destMount = await findMountpoint ( to ) ;
197
197
const sameAdapter = srcMount . adapter === destMount . adapter ;
198
- const createArgs = t => ( { adapter : t . adapter , mount : t . mount } ) ;
199
198
200
199
const srcStrict = srcMount . mount . attributes . strictGroups !== false ;
201
200
const destStrict = destMount . mount . attributes . strictGroups !== false ;
@@ -204,21 +203,21 @@ const createCrossRequestFactory = findMountpoint => (getter, method, respond) =>
204
203
205
204
if ( sameAdapter ) {
206
205
const result = await srcMount
207
- . adapter [ method ] ( createArgs ( srcMount ) , createArgs ( destMount ) ) ( from , to , options ) ;
206
+ . adapter [ method ] ( srcMount , destMount ) ( from , to , options ) ;
208
207
209
208
return ! ! result ;
210
209
}
211
210
212
211
// Simulates a copy/move
213
212
const stream = await srcMount . adapter
214
- . readfile ( createArgs ( srcMount ) ) ( from , options ) ;
213
+ . readfile ( srcMount ) ( from , options ) ;
215
214
216
215
const result = await destMount . adapter
217
- . writefile ( createArgs ( destMount ) ) ( to , stream , options ) ;
216
+ . writefile ( destMount ) ( to , stream , options ) ;
218
217
219
218
if ( method === 'rename' ) {
220
219
await srcMount . adapter
221
- . unlink ( createArgs ( srcMount ) ) ( from , options ) ;
220
+ . unlink ( srcMount ) ( from , options ) ;
222
221
}
223
222
224
223
return ! ! result ;
0 commit comments