mirror of
https://github.com/PR0M3TH3AN/TORCH.git
synced 2026-10-27 07:51:52 +00:00
Refactor ensureDir to remove redundant existence check
- Remove explicit `fs.existsSync` check in `ensureDir`.
- Rely on `fs.mkdirSync(dir, { recursive: true })` idempotency.
- Verified with existing tests in `test/ops.test.mjs`.
Co-authored-by: PR0M3TH3AN <[email protected]>
This commit is contained in:
1 parent
695adb6dc9
commit
758d3c3c56
1 file changed
+1
-3
+1
-3
@@ -29,9 +29,7 @@ function getPaths(userRoot) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function ensureDir(dir) {
|
function ensureDir(dir) {
|
||||||
if (!fs.existsSync(dir)) {
|
fs.mkdirSync(dir, { recursive: true });
|
||||||
fs.mkdirSync(dir, { recursive: true });
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function transformContent(content) {
|
function transformContent(content) {
|
||||||
|
|||||||
Reference in new issue
Block a user