From 08a6bd8049b3fb4acccb894b1626754f06894ac1 Mon Sep 17 00:00:00 2001 From: Jelle van der Waa Date: Mon, 23 Sep 2024 13:49:35 +0200 Subject: [PATCH] build.js: prefer startsWith over regex with a caret Found by eslint-plugin-unicorn. --- build.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/build.js b/build.js index 9164e9ab4..86cf152ca 100755 --- a/build.js +++ b/build.js @@ -57,8 +57,7 @@ function watch_dirs(dir, on_change) { const callback = (ev, dir, fname) => { // only listen for "change" events, as renames are noisy // ignore hidden files and the "4913" temporary file created by vim - const isHidden = /^\./.test(fname); - if (ev !== "change" || isHidden || fname === "4913") + if (ev !== "change" || fname.startsWith('.') || fname === "4913") return; on_change(path.join(dir, fname)); };