| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 3badc11 commit 5183e3a
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -97,8 +97,11 @@ class FilesWatcher extends EventEmitter { | |||
| 97 | 97 | return; | |
| 98 | 98 | } | |
| 99 | 99 | const watcher = watch(path, { recursive, signal: this.#signal }); | |
| 100 | - watcher.on('change', (eventType, fileName) => this | ||
| 101 | - .#onChange(recursive ? resolve(path, fileName ?? '') : path)); | ||
| 100 | + watcher.on('change', (eventType, fileName) => { | ||
| 101 | + // `fileName` can be `null` if it cannot be determined. See | ||
| 102 | + // https://github.com/nodejs/node/pull/49891#issuecomment-1744673430. | ||
| 103 | + this.#onChange(recursive ? resolve(path, fileName ?? '') : path); | ||
| 104 | + }); | ||
| 102 | 105 | this.#watchers.set(path, { handle: watcher, recursive }); | |
| 103 | 106 | if (recursive) { | |
| 104 | 107 | this.#removeWatchedChildren(path); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments