MCPcopy
hub / github.com/wavetermdev/waveterm / dfs

Function dfs

electron.vite.config.ts:41–57  ·  view source on GitHub ↗
(node: string)

Source from the content-addressed store, hash-verified

39 const seen = new Set<string>();
40 const stack: string[] = [];
41 const dfs = (node: string) => {
42 if (seen.has(node)) return;
43 seen.add(node);
44 stack.push(node);
45 const ps = parents.get(node) || [];
46 if (ps.length === 0) {
47 // hit a root (likely main entry or plugin virtual)
48 console.log("\nImporter chain:");
49 stack
50 .slice()
51 .reverse()
52 .forEach((s) => console.log(" ↳", s));
53 } else {
54 for (const p of ps) dfs(p);
55 }
56 stack.pop();
57 };
58
59 if (!parents.has(target)) {
60 console.log(`[who-imports] TARGET not in MAIN graph: ${target}`);

Callers 1

buildEndFunction · 0.85

Calls 3

pushMethod · 0.80
getMethod · 0.80
popMethod · 0.80

Tested by

no test coverage detected