Skip to content

Commit 5f285c7

Browse files
jellymartinpitt
authored andcommitted
build.js: prefer startsWith over regex with a caret
Found by eslint-plugin-unicorn.
1 parent 8809e37 commit 5f285c7

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

build.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,7 @@ function watch_dirs(dir, on_change) {
5757
const callback = (ev, dir, fname) => {
5858
// only listen for "change" events, as renames are noisy
5959
// ignore hidden files and the "4913" temporary file created by vim
60-
const isHidden = /^\./.test(fname);
61-
if (ev !== "change" || isHidden || fname === "4913")
60+
if (ev !== "change" || fname.startsWith('.') || fname === "4913")
6261
return;
6362
on_change(path.join(dir, fname));
6463
};

0 commit comments

Comments
 (0)