We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Learn more about funding links in repositories.
Report abuse
1 parent c48c3d2 commit 7c197b4Copy full SHA for 7c197b4
lib/watchEventSource.js
@@ -81,7 +81,9 @@ class DirectWatcher {
81
class RecursiveWatcher {
82
constructor(rootPath) {
83
this.rootPath = rootPath;
84
+ /** @type {Map<Watcher, string>} */
85
this.mapWatcherToPath = new Map();
86
+ /** @type {Map<string, Set<Watcher>>} */
87
this.mapPathToWatchers = new Map();
88
this.watcher = undefined;
89
try {
@@ -137,7 +139,7 @@ class RecursiveWatcher {
137
139
if (!subpath) return;
138
140
this.mapWatcherToPath.delete(watcher);
141
const set = this.mapPathToWatchers.get(subpath);
- set.delete(subpath);
142
+ set.delete(watcher);
143
if (set.size === 0) {
144
this.mapPathToWatchers.delete(subpath);
145
}
0 commit comments