()
| 108 | watchedDirs.set(dir, watcher); |
| 109 | } |
| 110 | |
| 111 | function syncWatchers() { |
| 112 | const nextDirs = new Set(); |
| 113 | |
| 114 | for (const root of watchRoots) { |
| 115 | for (const dir of listDirectories(root)) { |
| 116 | nextDirs.add(dir); |
| 117 | } |
| 118 | } |
| 119 | |
| 120 | for (const [dir, watcher] of watchedDirs) { |
| 121 | if (nextDirs.has(dir)) { |
| 122 | continue; |
| 123 | } |
| 124 | |
| 125 | watcher.close(); |
| 126 | watchedDirs.delete(dir); |
| 127 | } |
| 128 | |
| 129 | for (const dir of nextDirs) { |
| 130 | if (!watchedDirs.has(dir)) { |
| 131 | addWatcher(dir); |
| 132 | } |
| 133 | } |
| 134 | } |
| 135 | |
| 136 | function startServer() { |
no test coverage detected