We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a50e7c5 commit d5455c6Copy full SHA for d5455c6
lib/internal/fs/cp/cp-sync.js
@@ -158,11 +158,6 @@ function handleFilterAndCopy(destStat, src, dest, opts) {
158
return getStats(destStat, src, dest, opts);
159
}
160
161
-function startCopy(destStat, src, dest, opts) {
162
- if (opts.filter && !opts.filter(src, dest)) return;
163
- return getStats(destStat, src, dest, opts);
164
-}
165
-
166
function getStats(destStat, src, dest, opts) {
167
const statSyncFn = opts.dereference ? statSync : lstatSync;
168
const srcStat = statSyncFn(src);
@@ -284,9 +279,9 @@ function copyDir(src, dest, opts) {
284
279
const { name } = dirent;
285
280
const srcItem = join(src, name);
286
281
const destItem = join(dest, name);
282
+ if (opts.filter && !opts.filter(srcItem, destItem)) continue;
287
283
const { destStat } = checkPathsSync(srcItem, destItem, opts);
288
289
- startCopy(destStat, srcItem, destItem, opts);
+ getStats(destStat, src, dest, opts);
290
291
} finally {
292
dir.closeSync();
0 commit comments