watch: fix variable naming

PR-URL: https://github.com/nodejs/node/pull/53101
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Zijian Liu <lxxyxzj@gmail.com>
This commit is contained in:
jakecastelli authored and Marco Ippolito committed 2024-07-19 15:26:53 +02:00
1 parent 23f086c363
commit 1a2f3ab4f5
1 file changed
+7 -7
+7 -7
View File
@@ -27,7 +27,7 @@ const supportsRecursiveWatching = process.platform === 'win32' ||
class FilesWatcher extends EventEmitter {
#watchers = new SafeMap();
#filteredFiles = new SafeSet();
#depencencyOwners = new SafeMap();
#dependencyOwners = new SafeMap();
#ownerDependencies = new SafeMap();
#debounceOwners = new SafeSet();
#debounceTimer;
@@ -84,7 +84,7 @@ class FilesWatcher extends EventEmitter {
if (this.#mode === 'filter' && !this.#filteredFiles.has(trigger)) {
return;
}
const owners = this.#depencencyOwners.get(trigger);
const owners = this.#dependencyOwners.get(trigger);
if (owners) {
for (const owner of owners) {
this.#debounceOwners.add(owner);
@@ -129,11 +129,11 @@ class FilesWatcher extends EventEmitter {
}
this.#filteredFiles.add(file);
if (owner) {
const owners = this.#depencencyOwners.get(file) ?? new SafeSet();
const owners = this.#dependencyOwners.get(file) ?? new SafeSet();
const dependencies = this.#ownerDependencies.get(file) ?? new SafeSet();
owners.add(owner);
dependencies.add(file);
this.#depencencyOwners.set(file, owners);
this.#dependencyOwners.set(file, owners);
this.#ownerDependencies.set(owner, dependencies);
}
}
@@ -182,10 +182,10 @@ class FilesWatcher extends EventEmitter {
owners.forEach((owner) => {
this.#ownerDependencies.get(owner)?.forEach((dependency) => {
this.#filteredFiles.delete(dependency);
this.#depencencyOwners.delete(dependency);
this.#dependencyOwners.delete(dependency);
});
this.#filteredFiles.delete(owner);
this.#depencencyOwners.delete(owner);
this.#dependencyOwners.delete(owner);
this.#ownerDependencies.delete(owner);
});
}
@@ -196,7 +196,7 @@ class FilesWatcher extends EventEmitter {
this.#watchers.forEach(this.#unwatch);
this.#watchers.clear();
this.#filteredFiles.clear();
this.#depencencyOwners.clear();
this.#dependencyOwners.clear();
this.#ownerDependencies.clear();
}
}