MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / closure

Function closure

apps/cloud/scripts/start-closure.mjs:65–75  ·  view source on GitHub ↗
(roots)

Source from the content-addressed store, hash-verified

63
64/** Bytes evaluated when `roots` are loaded, following static edges only. */
65const closure = (roots) => {
66 const seen = new Set();
67 const queue = [...roots];
68 while (queue.length > 0) {
69 const file = queue.pop();
70 if (seen.has(file) || !graph.has(file)) continue;
71 seen.add(file);
72 queue.push(...graph.get(file).static);
73 }
74 return seen;
75};
76
77const bytes = (files) => [...files].reduce((sum, f) => sum + (graph.get(f)?.size ?? 0), 0);
78const mb = (n) => `${(n / 1024 / 1024).toFixed(2)} MB`;

Callers 1

start-closure.mjsFile · 0.85

Calls 2

pushMethod · 0.80
getMethod · 0.65

Tested by

no test coverage detected