(blocks: Record<string, BlockState>)
| 206 | * @returns Record of Loop objects for execution engine |
| 207 | */ |
| 208 | export function generateLoopBlocks(blocks: Record<string, BlockState>): Record<string, Loop> { |
| 209 | const loops: Record<string, Loop> = {} |
| 210 | |
| 211 | Object.entries(blocks) |
| 212 | .filter(([_, block]) => block.type === 'loop') |
| 213 | .forEach(([id, block]) => { |
| 214 | const loop = convertLoopBlockToLoop(id, blocks) |
| 215 | if (loop) { |
| 216 | loops[id] = loop |
| 217 | } |
| 218 | }) |
| 219 | |
| 220 | return loops |
| 221 | } |
| 222 | |
| 223 | /** |
| 224 | * Builds a complete collection of parallel blocks from the UI blocks |
no test coverage detected