(raw: string)
| 15 | }; |
| 16 | |
| 17 | export function readCliBatchStepsJson(raw: string): BatchStep[] { |
| 18 | let parsed: unknown; |
| 19 | try { |
| 20 | parsed = JSON.parse(raw); |
| 21 | } catch { |
| 22 | throw new AppError('INVALID_ARGS', 'Batch steps must be valid JSON.'); |
| 23 | } |
| 24 | if (!Array.isArray(parsed) || parsed.length === 0) { |
| 25 | throw new AppError('INVALID_ARGS', 'Batch steps must be a non-empty JSON array.'); |
| 26 | } |
| 27 | return normalizeCliBatchSteps(parsed); |
| 28 | } |
| 29 | |
| 30 | function normalizeCliBatchSteps(steps: unknown[]): BatchStep[] { |
| 31 | let sawLegacyStep = false; |
no test coverage detected
searching dependent graphs…