From 1a2f3ab4f55252581baf32a10f372fcbdb43bc73 Mon Sep 17 00:00:00 2001 From: jakecastelli <38635403+jakecastelli@users.noreply.github.com> Date: Fri, 24 May 2024 15:01:05 +0930 Subject: [PATCH] watch: fix variable naming PR-URL: https://github.com/nodejs/node/pull/53101 Reviewed-By: Moshe Atlow Reviewed-By: Luigi Pinca Reviewed-By: Antoine du Hamel Reviewed-By: Zijian Liu --- lib/internal/watch_mode/files_watcher.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/internal/watch_mode/files_watcher.js b/lib/internal/watch_mode/files_watcher.js index fda52e88b8d8ad..e4cb1a1ff566d2 100644 --- a/lib/internal/watch_mode/files_watcher.js +++ b/lib/internal/watch_mode/files_watcher.js @@ -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(); } }