Skip to content

Commit a12dfd5

Browse files
authored
fix: convert if/else logic to reduce nested if level (#84)
1 parent 7524cd6 commit a12dfd5

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

src/file-util.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,11 @@ export function copyModuleContents(directory: string, tmpDir: string, baseDirect
4444
fs.mkdirSync(newDir, { recursive: true });
4545
// Note: Important we pass the original base directory.
4646
copyModuleContents(filePath, newDir, baseDir); // Recursion for directory contents
47-
} else {
47+
} else if (!shouldExcludeFile(baseDir, filePath, config.moduleAssetExcludePatterns)) {
4848
// Handle file copying
49-
if (!shouldExcludeFile(baseDir, filePath, config.moduleAssetExcludePatterns)) {
50-
fs.copyFileSync(filePath, path.join(tmpDir, file));
51-
} else {
52-
info(`Excluding file: ${filePath}`);
53-
}
49+
fs.copyFileSync(filePath, path.join(tmpDir, file));
50+
} else {
51+
info(`Excluding file: ${filePath}`);
5452
}
5553
}
5654
}

0 commit comments

Comments
 (0)