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

Function createEdge

packages/reactivity/src/dag-builder.ts:51–75  ·  view source on GitHub ↗
(fromBlockId: string, toBlockId: string, variableName: string)

Source from the content-addressed store, hash-verified

49 }, {})
50
51 const createEdge = (fromBlockId: string, toBlockId: string, variableName: string) => {
52 const toNode = nodes[toBlockId]
53 if (!toNode) {
54 return
55 }
56
57 if (!toNode.inputVariables.includes(variableName)) {
58 toNode.inputVariables.push(variableName)
59 }
60
61 const fromNode = nodes[fromBlockId]
62 if (!fromNode) {
63 return
64 }
65
66 if (!fromNode.outputVariables.includes(variableName)) {
67 fromNode.outputVariables.push(variableName)
68 }
69
70 edges.push({
71 from: fromBlockId,
72 to: toBlockId,
73 inputVariables: [variableName],
74 })
75 }
76
77 // We are not simply adding all edges based on usedVariables to definedVariables.
78 // We are taking block order into account - creating edges only with the closest defining block

Callers 1

buildDagFromBlocksFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected