(
options: Omit<BlockFactoryOptions, 'type'> & {
loopType?: 'for' | 'forEach' | 'while' | 'doWhile'
count?: number
} = {}
)
| 123 | * Creates a loop block (iteration container). |
| 124 | */ |
| 125 | export function createLoopBlock( |
| 126 | options: Omit<BlockFactoryOptions, 'type'> & { |
| 127 | loopType?: 'for' | 'forEach' | 'while' | 'doWhile' |
| 128 | count?: number |
| 129 | } = {} |
| 130 | ): any { |
| 131 | const data: BlockData = { |
| 132 | ...options.data, |
| 133 | loopType: options.loopType ?? 'for', |
| 134 | count: options.count ?? 3, |
| 135 | type: 'loop', |
| 136 | } |
| 137 | |
| 138 | return createBlock({ |
| 139 | ...options, |
| 140 | type: 'loop', |
| 141 | name: options.name ?? 'Loop', |
| 142 | data, |
| 143 | }) |
| 144 | } |
| 145 | |
| 146 | /** |
| 147 | * Creates a parallel block (concurrent execution container). |
no test coverage detected