MCPcopy Index your code
hub / github.com/deepnote/deepnote / buildChildrenMap

Function buildChildrenMap

packages/cli/src/commands/dag.ts:210–220  ·  view source on GitHub ↗

* Build a map of node ID -> child IDs (nodes that depend on this node).

(dag: BlockDependencyDag)

Source from the content-addressed store, hash-verified

208 * Build a map of node ID -> child IDs (nodes that depend on this node).
209 */
210function buildChildrenMap(dag: BlockDependencyDag): Map<string, { id: string; variables: string[] }[]> {
211 const children = new Map<string, { id: string; variables: string[] }[]>()
212
213 for (const edge of dag.edges) {
214 const existing = children.get(edge.from) ?? []
215 existing.push({ id: edge.to, variables: edge.inputVariables })
216 children.set(edge.from, existing)
217 }
218
219 return children
220}
221
222/**
223 * Build a map of node ID -> DagNode.

Callers 1

outputDagShowFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected