(nodeDependencies: INodeDependencies)
| 211 | * @param {INodeDependencies} nodeDependencies |
| 212 | */ |
| 213 | export const getStartingNode = (nodeDependencies: INodeDependencies) => { |
| 214 | // Find starting node |
| 215 | const startingNodeIds = [] as string[] |
| 216 | Object.keys(nodeDependencies).forEach((nodeId) => { |
| 217 | if (nodeDependencies[nodeId] === 0) { |
| 218 | startingNodeIds.push(nodeId) |
| 219 | } |
| 220 | }) |
| 221 | |
| 222 | return { startingNodeIds } |
| 223 | } |
| 224 | |
| 225 | /** |
| 226 | * Get starting nodes and check if flow is valid |