MCPcopy
hub / github.com/simstudioai/sim / createLoopBlock

Function createLoopBlock

packages/testing/src/factories/block.factory.ts:125–144  ·  view source on GitHub ↗
(
  options: Omit<BlockFactoryOptions, 'type'> & {
    loopType?: 'for' | 'forEach' | 'while' | 'doWhile'
    count?: number
  } = {}
)

Source from the content-addressed store, hash-verified

123 * Creates a loop block (iteration container).
124 */
125export 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).

Callers 3

utils.test.tsFile · 0.90
utils.test.tsFile · 0.90
utils.test.tsFile · 0.90

Calls 1

createBlockFunction · 0.70

Tested by

no test coverage detected