MCPcopy Create free account
hub / github.com/NativeScript/NativeScript / visit

Function visit

packages/vite/hmr/server/websocket.ts:2214–2230  ·  view source on GitHub ↗
(id: string)

Source from the content-addressed store, hash-verified

2212 const temp = new Set<string>();
2213 const perm = new Set<string>();
2214 const visit = (id: string) => {
2215 if (perm.has(id)) return;
2216 if (temp.has(id)) {
2217 perm.add(id);
2218 return;
2219 } // cycle: bail out
2220 temp.add(id);
2221 const m = graph.get(id);
2222 if (m) {
2223 for (const d of m.deps) {
2224 if (toVisit.has(d)) visit(d);
2225 }
2226 }
2227 temp.delete(id);
2228 perm.add(id);
2229 ordered.push(id);
2230 };
2231 for (const id of toVisit) visit(id);
2232 // Ensure we only include those that were part of closure (already ensured) and preserve an order where deps appear before dependents
2233 return ordered;

Callers 1

Calls 4

addMethod · 0.65
getMethod · 0.65
deleteMethod · 0.65
pushMethod · 0.45

Tested by

no test coverage detected