• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

rokucommunity / brighterscript / #10414

pending completion
#10414

push

web-flow
Bump semver from 5.7.1 to 5.7.2 (#837)

Bumps [semver](https://github.com/npm/node-semver) from 5.7.1 to 5.7.2.
- [Release notes](https://github.com/npm/node-semver/releases)
- [Changelog](https://github.com/npm/node-semver/blob/v5.7.2/CHANGELOG.md)
- [Commits](https://github.com/npm/node-semver/compare/v5.7.1...v5.7.2)

---
updated-dependencies:
- dependency-name: semver
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

5536 of 6744 branches covered (82.09%)

Branch coverage included in aggregate %.

8410 of 9083 relevant lines covered (92.59%)

1635.73 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

11.11
/src/Watcher.ts
1
import * as chokidar from 'chokidar';
1✔
2

3
import type { BsConfig } from './BsConfig';
4

5
/**
6
 * There are some bugs with chokidar, so this attempts to mitigate them
7
 */
8
export class Watcher {
1✔
9
    constructor(
10
        private options: BsConfig
×
11
    ) {
12

13
    }
14

15
    private watchers = <chokidar.FSWatcher[]>[];
×
16

17
    /**
18
     * Watch the paths or globs
19
     */
20
    public watch(paths: string | string[]) {
21
        let watcher = chokidar.watch(paths, {
×
22
            cwd: this.options.rootDir,
23
            ignoreInitial: true,
24
            awaitWriteFinish: {
25
                stabilityThreshold: 200,
26
                pollInterval: 100
27
            }
28
        });
29
        this.watchers.push(watcher);
×
30

31
        return async () => {
×
32
            //unwatch all paths
33
            watcher.unwatch(paths);
×
34
            //close the watcher
35
            await watcher.close();
×
36
            //remove the watcher from our list
37
            this.watchers.splice(this.watchers.indexOf(watcher), 1);
×
38
        };
39
    }
40

41
    /**
42
     * Be notified of all events
43
     */
44
    public on(event: 'all', callback: (event, path, details) => void) {
45
        let watchers = [...this.watchers];
×
46
        for (let watcher of watchers) {
×
47
            watcher.on(event, callback);
×
48
        }
49

50
        //a disconnect function
51
        return () => {
×
52
            for (let watcher of watchers) {
×
53
                watcher.removeListener('all', callback);
×
54
            }
55
        };
56
    }
57

58
    public dispose() {
59
        for (let watcher of this.watchers) {
×
60
            watcher.removeAllListeners();
×
61
        }
62
    }
63
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc