(step: unknown, stepNumber: number)
| 73 | } |
| 74 | |
| 75 | function readLegacyCliBatchStep(step: unknown, stepNumber: number): LegacyCliBatchStep { |
| 76 | if (!isRecord(step)) { |
| 77 | throw new AppError('INVALID_ARGS', `Invalid batch step ${stepNumber}.`); |
| 78 | } |
| 79 | assertLegacyBatchStepKeys(step, stepNumber); |
| 80 | const command = readLegacyCommand(step.command, stepNumber); |
| 81 | const positionals = readLegacyPositionals(step.positionals, stepNumber); |
| 82 | const flags = readLegacyFlags(step.flags, stepNumber); |
| 83 | const runtime = parseBatchStepRuntime(step.runtime, stepNumber); |
| 84 | return { |
| 85 | command, |
| 86 | ...(positionals === undefined ? {} : { positionals }), |
| 87 | ...(flags === undefined ? {} : { flags }), |
| 88 | ...(runtime === undefined ? {} : { runtime }), |
| 89 | }; |
| 90 | } |
| 91 | |
| 92 | function readLegacyCommand(value: unknown, stepNumber: number): CommandName { |
| 93 | const command = typeof value === 'string' ? value.trim().toLowerCase() : ''; |
no test coverage detected