@@ -71,25 +71,25 @@ export async function copy(
71
71
const { 0 : srcStat , 1 : destStat } = await getStats ( src , dest , options ) ;
72
72
if ( destStat ) {
73
73
if ( areIdentical ( srcStat , destStat ) ) {
74
- throw new Error ( `[path-nice] copy(): src and dest cannot be the same` ) ;
74
+ throw new Error ( `[path-nice] . copy(): src and dest cannot be the same` ) ;
75
75
}
76
76
if ( srcStat . isDirectory ( ) && ! destStat . isDirectory ( ) ) {
77
77
throw new Error (
78
- `[path-nice] copy(): cannot overwrite directory ${ src } ` +
78
+ `[path-nice] . copy(): cannot overwrite directory ${ src } ` +
79
79
`with non-directory ${ dest } ` ,
80
80
) ;
81
81
}
82
82
if ( ! srcStat . isDirectory ( ) && destStat . isDirectory ( ) ) {
83
83
throw new Error (
84
- `[path-nice] copy(): cannot overwrite non-directory ${ src } ` +
84
+ `[path-nice] . copy(): cannot overwrite non-directory ${ src } ` +
85
85
`with directory ${ dest } ` ,
86
86
) ;
87
87
}
88
88
}
89
89
90
90
if ( srcStat . isDirectory ( ) && isSrcSubdir ( src , dest ) ) {
91
91
throw new Error (
92
- `[path-nice] copy(): cannot copy ${ src } to a subdirectory of self ${ dest } ` ,
92
+ `[path-nice] . copy(): cannot copy ${ src } to a subdirectory of self ${ dest } ` ,
93
93
) ;
94
94
}
95
95
return { srcStat, destStat } ;
@@ -164,7 +164,7 @@ export async function copy(
164
164
}
165
165
if ( areIdentical ( srcStat , destStat ) ) {
166
166
throw new Error (
167
- `[path-nice] copy(): cannot copy ${ src } to a subdirectory of self ${ dest } ` ,
167
+ `[path-nice] . copy(): cannot copy ${ src } to a subdirectory of self ${ dest } ` ,
168
168
) ;
169
169
}
170
170
return checkParentPaths ( src , srcStat , destParent ) ;
@@ -212,7 +212,7 @@ export async function copy(
212
212
if ( srcStat . isDirectory ( ) && options . recursive ) {
213
213
return onDir ( srcStat , destStat , src , dest , options ) ;
214
214
} else if ( srcStat . isDirectory ( ) ) {
215
- throw new Error ( `[path-nice] copy(): ${ src } is a directory (not copied)` ) ;
215
+ throw new Error ( `[path-nice] . copy(): ${ src } is a directory (not copied)` ) ;
216
216
} else if (
217
217
srcStat . isFile ( ) ||
218
218
srcStat . isCharacterDevice ( ) ||
@@ -222,11 +222,11 @@ export async function copy(
222
222
} else if ( srcStat . isSymbolicLink ( ) ) {
223
223
return onLink ( destStat , src , dest , options ) ;
224
224
} else if ( srcStat . isSocket ( ) ) {
225
- throw new Error ( `[path-nice] copy(): cannot copy a socket file: ${ dest } ` ) ;
225
+ throw new Error ( `[path-nice] . copy(): cannot copy a socket file: ${ dest } ` ) ;
226
226
} else if ( srcStat . isFIFO ( ) ) {
227
- throw new Error ( `[path-nice] copy(): cannot copy a FIFO pipe: ${ dest } ` ) ;
227
+ throw new Error ( `[path-nice] . copy(): cannot copy a FIFO pipe: ${ dest } ` ) ;
228
228
}
229
- throw new Error ( `[path-nice] copy(): cannot copy an unknown file type: ${ dest } ` ) ;
229
+ throw new Error ( `[path-nice] . copy(): cannot copy an unknown file type: ${ dest } ` ) ;
230
230
}
231
231
232
232
function onFile ( srcStat : any , destStat : any , src : any , dest : any , options : any ) {
@@ -239,7 +239,7 @@ export async function copy(
239
239
await unlink ( dest ) ;
240
240
return _copyFile ( srcStat , src , dest , options ) ;
241
241
} else if ( options . errorOnExist ) {
242
- throw new Error ( `[path-nice] copy(): ${ dest } already exists` ) ;
242
+ throw new Error ( `[path-nice] . copy(): ${ dest } already exists` ) ;
243
243
}
244
244
}
245
245
@@ -334,7 +334,7 @@ export async function copy(
334
334
}
335
335
if ( isSrcSubdir ( resolvedSrc , resolvedDest ) ) {
336
336
throw new Error (
337
- `[path-nice] copy(): cannot copy ${ resolvedSrc } to a subdirectory of self ` +
337
+ `[path-nice] . copy(): cannot copy ${ resolvedSrc } to a subdirectory of self ` +
338
338
`${ resolvedDest } ` ,
339
339
) ;
340
340
}
@@ -344,7 +344,7 @@ export async function copy(
344
344
const srcStat = await stat ( src ) ;
345
345
if ( srcStat . isDirectory ( ) && isSrcSubdir ( resolvedDest , resolvedSrc ) ) {
346
346
throw new Error (
347
- `[path-nice] copy(): cannot overwrite ${ resolvedDest } with ${ resolvedSrc } ` ,
347
+ `[path-nice] . copy(): cannot overwrite ${ resolvedDest } with ${ resolvedSrc } ` ,
348
348
) ;
349
349
}
350
350
return copyLink ( resolvedSrc , dest ) ;
@@ -399,26 +399,26 @@ export function copySync(
399
399
if ( destStat ) {
400
400
if ( areIdentical ( srcStat , destStat ) ) {
401
401
throw new Error (
402
- `[path-nice] copySync(): src and dest cannot be the same` ,
402
+ `[path-nice] . copySync(): src and dest cannot be the same` ,
403
403
) ;
404
404
}
405
405
if ( srcStat . isDirectory ( ) && ! destStat . isDirectory ( ) ) {
406
406
throw new Error (
407
- `[path-nice] copySync(): cannot overwrite directory ${ src } ` +
407
+ `[path-nice] . copySync(): cannot overwrite directory ${ src } ` +
408
408
`with non-directory ${ dest } ` ,
409
409
) ;
410
410
}
411
411
if ( ! srcStat . isDirectory ( ) && destStat . isDirectory ( ) ) {
412
412
throw new Error (
413
- `[path-nice] copySync(): cannot overwrite non-directory ${ src } ` +
413
+ `[path-nice] . copySync(): cannot overwrite non-directory ${ src } ` +
414
414
`with directory ${ dest } ` ,
415
415
) ;
416
416
}
417
417
}
418
418
419
419
if ( srcStat . isDirectory ( ) && isSrcSubdir ( src , dest ) ) {
420
420
throw new Error (
421
- `[path-nice] copySync(): cannot copy ${ src } to a subdirectory of self ${ dest } ` ,
421
+ `[path-nice] . copySync(): cannot copy ${ src } to a subdirectory of self ${ dest } ` ,
422
422
) ;
423
423
}
424
424
return { srcStat, destStat } ;
@@ -495,7 +495,7 @@ export function copySync(
495
495
}
496
496
if ( areIdentical ( srcStat , destStat ) ) {
497
497
throw new Error (
498
- `[path-nice] copySync(): cannot copy ${ src } to a subdirectory of self ${ dest } ` ,
498
+ `[path-nice] . copySync(): cannot copy ${ src } to a subdirectory of self ${ dest } ` ,
499
499
) ;
500
500
}
501
501
return checkParentPaths ( src , srcStat , destParent ) ;
@@ -543,7 +543,7 @@ export function copySync(
543
543
if ( srcStat . isDirectory ( ) && options . recursive ) {
544
544
return onDir ( srcStat , destStat , src , dest , options ) ;
545
545
} else if ( srcStat . isDirectory ( ) ) {
546
- throw new Error ( `[path-nice] copySync(): ${ src } is a directory (not copied)` ) ;
546
+ throw new Error ( `[path-nice] . copySync(): ${ src } is a directory (not copied)` ) ;
547
547
} else if (
548
548
srcStat . isFile ( ) ||
549
549
srcStat . isCharacterDevice ( ) ||
@@ -553,12 +553,12 @@ export function copySync(
553
553
} else if ( srcStat . isSymbolicLink ( ) ) {
554
554
return onLink ( destStat , src , dest , options ) ;
555
555
} else if ( srcStat . isSocket ( ) ) {
556
- throw new Error ( `[path-nice] copySync(): cannot copy a socket file: ${ dest } ` ) ;
556
+ throw new Error ( `[path-nice] . copySync(): cannot copy a socket file: ${ dest } ` ) ;
557
557
} else if ( srcStat . isFIFO ( ) ) {
558
- throw new Error ( `[path-nice] copySync(): cannot copy a FIFO pipe: ${ dest } ` ) ;
558
+ throw new Error ( `[path-nice] . copySync(): cannot copy a FIFO pipe: ${ dest } ` ) ;
559
559
}
560
560
throw new Error (
561
- `[path-nice] copySync(): cannot copy an unknown file type: ${ dest } ` ,
561
+ `[path-nice] . copySync(): cannot copy an unknown file type: ${ dest } ` ,
562
562
) ;
563
563
}
564
564
@@ -572,7 +572,7 @@ export function copySync(
572
572
unlinkSync ( dest ) ;
573
573
return _copyFile ( srcStat , src , dest , options ) ;
574
574
} else if ( options . errorOnExist ) {
575
- throw new Error ( `[path-nice] copySync(): ${ dest } already exists` ) ;
575
+ throw new Error ( `[path-nice] . copySync(): ${ dest } already exists` ) ;
576
576
}
577
577
}
578
578
@@ -667,7 +667,7 @@ export function copySync(
667
667
}
668
668
if ( isSrcSubdir ( resolvedSrc , resolvedDest ) ) {
669
669
throw new Error (
670
- `[path-nice] copySync(): cannot copy ${ resolvedSrc } to a subdirectory ` +
670
+ `[path-nice] . copySync(): cannot copy ${ resolvedSrc } to a subdirectory ` +
671
671
`of self ${ resolvedDest } ` ,
672
672
) ;
673
673
}
@@ -677,7 +677,7 @@ export function copySync(
677
677
const srcStat = statSync ( src ) ;
678
678
if ( srcStat . isDirectory ( ) && isSrcSubdir ( resolvedDest , resolvedSrc ) ) {
679
679
throw new Error (
680
- `[path-nice] copySync(): cannot overwrite ${ resolvedDest } with ${ resolvedSrc } ` ,
680
+ `[path-nice] . copySync(): cannot overwrite ${ resolvedDest } with ${ resolvedSrc } ` ,
681
681
) ;
682
682
}
683
683
return copyLink ( resolvedSrc , dest ) ;
0 commit comments