Skip to content

Build your personal knowledge base with Trilium Notes

build(copy-dist): execute filterableDirs cleanup in one chain

Panagiotis Papadopoulos8275f3c867ff
diff --git a/bin/copy-dist.ts b/bin/copy-dist.ts
index 5866508112..38413b1b96 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));
}