Skip to content

Commit

Permalink
build.js: prefer startsWith over regex with a caret
Browse files Browse the repository at this point in the history
Found by eslint-plugin-unicorn.
  • Loading branch information
jelly committed Sep 23, 2024
1 parent f930f59 commit 08a6bd8
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions build.js
Original file line number Diff line number Diff line change
Expand Up @@ -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));
};
Expand Down

0 comments on commit 08a6bd8

Please sign in to comment.