Skip to content

Commit

Permalink
fix(node): reduce deepReadDirSync runtime complexity (#7910)
Browse files Browse the repository at this point in the history
  • Loading branch information
JonasBa authored Apr 19, 2023
1 parent b4121cb commit 7896c68
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/node/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,11 @@ export function deepReadDirSync(targetDir: string): string[] {
const itemAbsPath = path.join(currentDirAbsPath, itemName);

if (fs.statSync(itemAbsPath).isDirectory()) {
return [...absPaths, ...deepReadCurrentDir(itemAbsPath)];
return absPaths.concat(deepReadCurrentDir(itemAbsPath));
}

return [...absPaths, itemAbsPath];
absPaths.push(itemAbsPath);
return absPaths;
}, []);
};

Expand Down

0 comments on commit 7896c68

Please sign in to comment.