From 8275f3c867fff674db44e938f96ce059fa3002df Mon Sep 17 00:00:00 2001 From: Panagiotis Papadopoulos Date: Sun, 16 Mar 2025 02:10:47 +0100 Subject: [PATCH] build(copy-dist): execute filterableDirs cleanup in one chain --- bin/copy-dist.ts | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/bin/copy-dist.ts b/bin/copy-dist.ts index 586650811..38413b1b9 100644 --- a/bin/copy-dist.ts +++ b/bin/copy-dist.ts @@ -82,13 +82,10 @@ function cleanupNodeModules() { "tests" ]); - const filteredDirs = nodeDir + nodeDir .filter(el => el.isDirectory() && filterableDirs.has(el.name)) - .map(el => path.join(DEST_DIR, el.parentPath, el.name)); - - filteredDirs.forEach(dir => { - fs.removeSync(dir); - }) + .map(el => path.join(DEST_DIR, el.parentPath, el.name)) + .forEach(dir => fs.removeSync(dir)); }