Skip to content

Commit 7896c68

Browse files
authored
fix(node): reduce deepReadDirSync runtime complexity (#7910)
1 parent b4121cb commit 7896c68

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

packages/node/src/utils.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,11 @@ export function deepReadDirSync(targetDir: string): string[] {
2727
const itemAbsPath = path.join(currentDirAbsPath, itemName);
2828

2929
if (fs.statSync(itemAbsPath).isDirectory()) {
30-
return [...absPaths, ...deepReadCurrentDir(itemAbsPath)];
30+
return absPaths.concat(deepReadCurrentDir(itemAbsPath));
3131
}
3232

33-
return [...absPaths, itemAbsPath];
33+
absPaths.push(itemAbsPath);
34+
return absPaths;
3435
}, []);
3536
};
3637

0 commit comments

Comments
 (0)