(input: unknown, fields: ReturnType<typeof batchFields>)
| 106 | } |
| 107 | |
| 108 | function readBatchInput(input: unknown, fields: ReturnType<typeof batchFields>): BatchInput { |
| 109 | const parsed = readFieldInput(input, fields); |
| 110 | const maxSteps = parsed.maxSteps ?? DEFAULT_BATCH_MAX_STEPS; |
| 111 | if (!isValidBatchMaxSteps(maxSteps)) { |
| 112 | throw new Error(`Invalid batch maxSteps: ${String(parsed.maxSteps)}`); |
| 113 | } |
| 114 | assertBatchStepCount(parsed.steps.length, maxSteps, batchPlainError); |
| 115 | return { |
| 116 | ...parsed, |
| 117 | }; |
| 118 | } |
| 119 | |
| 120 | function readBatchSteps(steps: unknown, nestedCommands: readonly string[]): BatchCommandStep[] { |
| 121 | if (!Array.isArray(steps)) { |
no test coverage detected
searching dependent graphs…