MCPcopy Create free account
hub / github.com/RtlZeroMemory/Rezi / collectWatchDirectories

Function collectWatchDirectories

packages/node/src/dev/hotStateReload.ts:212–229  ·  view source on GitHub ↗
(root: string)

Source from the content-addressed store, hash-verified

210}
211
212function collectWatchDirectories(root: string): readonly string[] {
213 const out: string[] = [];
214 const stack: string[] = [root];
215
216 while (stack.length > 0) {
217 const current = stack.pop();
218 if (!current) continue;
219 out.push(current);
220 const entries = safeReadDir(current);
221 for (const entry of entries) {
222 if (!entry.isDirectory()) continue;
223 if (IGNORED_DIR_NAMES.has(entry.name)) continue;
224 stack.push(join(current, entry.name));
225 }
226 }
227
228 return Object.freeze(out);
229}
230
231function makeLogSink(
232 log: ((event: HotStateReloadLogEvent) => void) | undefined,

Callers 1

refreshWatchersFunction · 0.85

Calls 3

safeReadDirFunction · 0.85
pushMethod · 0.45
hasMethod · 0.45

Tested by

no test coverage detected