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) => {
|
const callback = (ev, dir, fname) => {
|
||||||
// only listen for "change" events, as renames are noisy
|
// only listen for "change" events, as renames are noisy
|
||||||
// ignore hidden files
|
// ignore hidden files
|
||||||
const isHidden = /^\./.test(fname);
|
if (ev !== "change" || fname.startsWith('.')) {
|
||||||
if (ev !== "change" || isHidden) {
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
on_change(path.join(dir, fname));
|
on_change(path.join(dir, fname));
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue