(nodeIds: string[])
| 143 | * ``` |
| 144 | */ |
| 145 | export function createLinearDAG(nodeIds: string[]): DAG { |
| 146 | const nodes = new Map<string, DAGNode>() |
| 147 | |
| 148 | for (let i = 0; i < nodeIds.length; i++) { |
| 149 | const id = nodeIds[i] |
| 150 | const outgoingEdges: DAGEdge[] = i < nodeIds.length - 1 ? [{ target: nodeIds[i + 1] }] : [] |
| 151 | const incomingEdges = i > 0 ? [nodeIds[i - 1]] : [] |
| 152 | |
| 153 | nodes.set(id, createDAGNode({ id, outgoingEdges, incomingEdges })) |
| 154 | } |
| 155 | |
| 156 | return { |
| 157 | nodes, |
| 158 | loopConfigs: new Map(), |
| 159 | parallelConfigs: new Map(), |
| 160 | } |
| 161 | } |
| 162 | |
| 163 | /** |
| 164 | * Adds a node to an existing DAG. |
nothing calls this directly
no test coverage detected