build.js: prefer startsWith over regex with a caret
Found by eslint-plugin-unicorn.
This commit is contained in:
parent
6089ae39d9
commit
4d8fc78a3f
1 changed files with 1 additions and 2 deletions
3
build.js
3
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
|
||||
const isHidden = /^\./.test(fname);
|
||||
if (ev !== "change" || isHidden) {
|
||||
if (ev !== "change" || fname.startsWith('.')) {
|
||||
return;
|
||||
}
|
||||
on_change(path.join(dir, fname));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue