Skip to content

Commit

Permalink
fs: add recursive cp method
Browse files Browse the repository at this point in the history
Co-authored-by: Antoine du Hamel <[email protected]>
  • Loading branch information
bcoe and aduh95 authored Aug 6, 2021
1 parent 39f1636 commit 25613ca
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions test/parallel/test-fs-cp.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -753,11 +753,11 @@ function assertDirEquivalent(dir1, dir2) {
}

function collectEntries(dir, dirEntries) {
const newEntries = [...readdirSync(dir, { withFileTypes: true })];
const newEntries = readdirSync(dir, { withFileTypes: true });
for (const entry of newEntries) {
if (entry.isDirectory()) {
collectEntries(join(dir, entry.name), dirEntries);
}
}
dirEntries.push.apply(dirEntries, newEntries);
dirEntries.push(...newEntries);
}

0 comments on commit 25613ca

Please sign in to comment.