From 758d3c3c56ff27e5340d6cd7946adc03492f1da5 Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Sat, 14 Feb 2026 14:13:58 +0000 Subject: [PATCH] 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 <53631862+PR0M3TH3AN@users.noreply.github.com> --- src/ops.mjs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/ops.mjs b/src/ops.mjs index 4fcaa5d..ec9be0a 100644 --- a/src/ops.mjs +++ b/src/ops.mjs @@ -29,9 +29,7 @@ function getPaths(userRoot) { } function ensureDir(dir) { - if (!fs.existsSync(dir)) { - fs.mkdirSync(dir, { recursive: true }); - } + fs.mkdirSync(dir, { recursive: true }); } function transformContent(content) {