@@ -80,7 +80,7 @@ module.exports = {
80
80
* @returns {Promise<Array> } - An array of Entries in that directory
81
81
*
82
82
*/
83
- readEntries : function ( [ [ fullPath ] ] ) {
83
+ readEntries : function ( [ fullPath ] ) {
84
84
return new Promise ( ( resolve , reject ) => {
85
85
fs . readdir ( fullPath , { withFileTypes : true } , ( err , files ) => {
86
86
if ( err ) {
@@ -131,7 +131,7 @@ module.exports = {
131
131
* fullPath: the full path of the file including the extension.
132
132
* @returns {Promise<Object> } - An Object containing the file metadata.
133
133
*/
134
- getFileMetadata : function ( [ [ fullPath ] ] ) {
134
+ getFileMetadata : function ( [ fullPath ] ) {
135
135
return new Promise ( ( resolve , reject ) => {
136
136
fs . stat ( fullPath , ( err , stats ) => {
137
137
if ( err ) {
@@ -158,7 +158,7 @@ module.exports = {
158
158
* fullPath: the full path of the file or directory.
159
159
* @returns {Promise<Object> } - An Object containing the metadata.
160
160
*/
161
- getMetadata : function ( [ [ url ] ] ) {
161
+ getMetadata : function ( [ url ] ) {
162
162
return new Promise ( ( resolve , reject ) => {
163
163
fs . stat ( url , ( err , stats ) => {
164
164
if ( err ) {
@@ -182,7 +182,7 @@ module.exports = {
182
182
* metadataObject: the object containing metadataValues (currently only supports modificationTime)
183
183
* @returns {Promise<Object> } - An Object containing the file metadata.
184
184
*/
185
- setMetadata : function ( [ [ fullPath , metadataObject ] ] ) {
185
+ setMetadata : function ( [ fullPath , metadataObject ] ) {
186
186
return new Promise ( ( resolve , reject ) => {
187
187
const modificationTime = metadataObject . modificationTime ;
188
188
const utimesError = function ( err ) {
@@ -208,7 +208,7 @@ module.exports = {
208
208
*
209
209
* @returns {Promise<String> } The string value within the file.
210
210
*/
211
- readAsText : function ( [ [ fileName , enc , startPos , endPos ] ] ) {
211
+ readAsText : function ( [ fileName , enc , startPos , endPos ] ) {
212
212
return readAs ( 'text' , fileName , enc , startPos , endPos ) ;
213
213
} ,
214
214
@@ -222,7 +222,7 @@ module.exports = {
222
222
*
223
223
* @returns {Promise<String> } the file as a dataUrl.
224
224
*/
225
- readAsDataURL : function ( [ [ fileName , startPos , endPos ] ] ) {
225
+ readAsDataURL : function ( [ fileName , startPos , endPos ] ) {
226
226
return readAs ( 'dataURL' , fileName , null , startPos , endPos ) ;
227
227
} ,
228
228
@@ -236,7 +236,7 @@ module.exports = {
236
236
*
237
237
* @returns {Promise<String> } The file as a binary string.
238
238
*/
239
- readAsBinaryString : function ( [ [ fileName , startPos , endPos ] ] ) {
239
+ readAsBinaryString : function ( [ fileName , startPos , endPos ] ) {
240
240
return readAs ( 'binaryString' , fileName , null , startPos , endPos ) ;
241
241
} ,
242
242
@@ -250,7 +250,7 @@ module.exports = {
250
250
*
251
251
* @returns {Promise<Array> } The file as an arrayBuffer.
252
252
*/
253
- readAsArrayBuffer : function ( [ [ fileName , startPos , endPos ] ] ) {
253
+ readAsArrayBuffer : function ( [ fileName , startPos , endPos ] ) {
254
254
return readAs ( 'arrayBuffer' , fileName , null , startPos , endPos ) ;
255
255
} ,
256
256
@@ -262,7 +262,7 @@ module.exports = {
262
262
*
263
263
* @returns {Promise<void> } resolves when file or directory is deleted.
264
264
*/
265
- remove : function ( [ [ fullPath ] ] ) {
265
+ remove : function ( [ fullPath ] ) {
266
266
return new Promise ( ( resolve , reject ) => {
267
267
fs . stat ( fullPath , ( err , stats ) => {
268
268
if ( err ) {
@@ -290,7 +290,7 @@ module.exports = {
290
290
*
291
291
* @returns {Promise<void> } resolves when file or directory is deleted.
292
292
*/
293
- removeRecursively : function ( [ [ fullPath ] ] ) {
293
+ removeRecursively : function ( [ fullPath ] ) {
294
294
return new Promise ( ( resolve , reject ) => {
295
295
fs . stat ( fullPath , ( err , stats ) => {
296
296
if ( err ) {
@@ -329,7 +329,7 @@ module.exports = {
329
329
*
330
330
* @returns {Promise<Object> } The parent directory object that is converted to DirectoryEntry by cordova.
331
331
*/
332
- getParent : function ( [ [ url ] ] ) {
332
+ getParent : function ( [ url ] ) {
333
333
const parentPath = path . dirname ( url ) ;
334
334
const parentName = path . basename ( parentPath ) ;
335
335
const fullPath = path . dirname ( parentPath ) + path . sep ;
@@ -347,7 +347,7 @@ module.exports = {
347
347
*
348
348
* @returns {Promise<Object> } The copied file.
349
349
*/
350
- copyTo : function ( [ [ srcPath , dstDir , dstName ] ] ) {
350
+ copyTo : function ( [ srcPath , dstDir , dstName ] ) {
351
351
return new Promise ( ( resolve , reject ) => {
352
352
if ( dstName . indexOf ( '/' ) !== - 1 || path . resolve ( srcPath ) === path . resolve ( dstDir + dstName ) ) {
353
353
reject ( new Error ( FileError . INVALID_MODIFICATION_ERR ) ) ;
@@ -360,7 +360,7 @@ module.exports = {
360
360
fs . stat ( srcPath )
361
361
. then ( ( stats ) => {
362
362
fs . copy ( srcPath , dstDir + dstName , { recursive : stats . isDirectory ( ) } )
363
- . then ( async ( ) => resolve ( await stats . isDirectory ( ) ? getDirectory ( [ [ dstDir , dstName ] ] ) : getFile ( [ [ dstDir , dstName ] ] ) ) )
363
+ . then ( async ( ) => resolve ( await stats . isDirectory ( ) ? getDirectory ( [ dstDir , dstName ] ) : getFile ( [ dstDir , dstName ] ) ) )
364
364
. catch ( ( ) => reject ( new Error ( FileError . ENCODING_ERR ) ) ) ;
365
365
} )
366
366
. catch ( ( ) => reject ( new Error ( FileError . NOT_FOUND_ERR ) ) ) ;
@@ -377,7 +377,7 @@ module.exports = {
377
377
*
378
378
* @returns {Promise<Object> } The moved file.
379
379
*/
380
- moveTo : function ( [ [ srcPath , dstDir , dstName ] ] ) {
380
+ moveTo : function ( [ srcPath , dstDir , dstName ] ) {
381
381
return new Promise ( ( resolve , reject ) => {
382
382
if ( dstName . indexOf ( '/' ) !== - 1 || path . resolve ( srcPath ) === path . resolve ( dstDir + dstName ) ) {
383
383
reject ( new Error ( FileError . INVALID_MODIFICATION_ERR ) ) ;
@@ -390,7 +390,7 @@ module.exports = {
390
390
fs . stat ( srcPath )
391
391
. then ( ( stats ) => {
392
392
fs . move ( srcPath , dstDir + dstName )
393
- . then ( async ( ) => resolve ( await stats . isDirectory ( ) ? getDirectory ( [ [ dstDir , dstName ] ] ) : getFile ( [ [ dstDir , dstName ] ] ) ) )
393
+ . then ( async ( ) => resolve ( await stats . isDirectory ( ) ? getDirectory ( [ dstDir , dstName ] ) : getFile ( [ dstDir , dstName ] ) ) )
394
394
. catch ( ( ) => reject ( new Error ( FileError . ENCODING_ERR ) ) ) ;
395
395
} )
396
396
. catch ( ( ) => reject ( new Error ( FileError . NOT_FOUND_ERR ) ) ) ;
@@ -404,7 +404,7 @@ module.exports = {
404
404
* uri: The full path for the file.
405
405
* @returns {Promise<Object> } The entry for the file or directory.
406
406
*/
407
- resolveLocalFileSystemURI : function ( [ [ uri ] ] ) {
407
+ resolveLocalFileSystemURI : function ( [ uri ] ) {
408
408
return new Promise ( ( resolve , reject ) => {
409
409
// support for encodeURI
410
410
if ( / \% 5 / g. test ( uri ) || / \% 2 0 / g. test ( uri ) ) { // eslint-disable-line no-useless-escape
@@ -478,7 +478,7 @@ module.exports = {
478
478
* position: the position offset to start writing from.
479
479
* @returns {Promise<Object> } An object with information about the amount of bytes written.
480
480
*/
481
- write : function ( [ [ fileName , data , position ] ] ) {
481
+ write : function ( [ fileName , data , position ] ) {
482
482
return new Promise ( ( resolve , reject ) => {
483
483
if ( ! data ) {
484
484
reject ( new Error ( FileError . INVALID_MODIFICATION_ERR ) ) ;
@@ -507,7 +507,7 @@ module.exports = {
507
507
* size: the length of the file to truncate to.
508
508
* @returns {Promise }
509
509
*/
510
- truncate : function ( [ [ fullPath , size ] ] ) {
510
+ truncate : function ( [ fullPath , size ] ) {
511
511
return new Promise ( ( resolve , reject ) => {
512
512
fs . truncate ( fullPath , size , err => {
513
513
if ( err ) {
@@ -520,7 +520,7 @@ module.exports = {
520
520
} ) ;
521
521
} ,
522
522
523
- requestFileSystem : function ( [ [ type , size ] ] ) {
523
+ requestFileSystem : function ( [ type , size ] ) {
524
524
if ( type !== 0 && type !== 1 ) {
525
525
throw new Error ( FileError . INVALID_MODIFICATION_ERR ) ;
526
526
}
@@ -590,7 +590,7 @@ function readAs (what, fullPath, encoding, startPos, endPos) {
590
590
*
591
591
* @returns {Promise<Object> } The file object that is converted to FileEntry by cordova.
592
592
*/
593
- function getFile ( [ [ dstDir , dstName , options ] ] ) {
593
+ function getFile ( [ dstDir , dstName , options ] ) {
594
594
const absolutePath = path . join ( dstDir , dstName ) ;
595
595
options = options || { } ;
596
596
return new Promise ( ( resolve , reject ) => {
@@ -662,7 +662,7 @@ function getFile ([[dstDir, dstName, options]]) {
662
662
*
663
663
* @returns {Promise<Object> } The directory object that is converted to DirectoryEntry by cordova.
664
664
*/
665
- function getDirectory ( [ [ dstDir , dstName , options ] ] ) {
665
+ function getDirectory ( [ dstDir , dstName , options ] ) {
666
666
const absolutePath = dstDir + dstName ;
667
667
options = options || { } ;
668
668
return new Promise ( ( resolve , reject ) => {
0 commit comments