(legacyStep: LegacyCliBatchStep)
| 44 | } |
| 45 | |
| 46 | function legacyStepToStructuredStep(legacyStep: LegacyCliBatchStep): BatchStep { |
| 47 | const input = readInputFromCli( |
| 48 | legacyStep.command, |
| 49 | legacyStep.positionals ?? [], |
| 50 | cliFlagsFromBatchStep(legacyStep.flags), |
| 51 | ); |
| 52 | return { |
| 53 | command: legacyStep.command, |
| 54 | input, |
| 55 | ...(legacyStep.runtime === undefined ? {} : { runtime: legacyStep.runtime }), |
| 56 | }; |
| 57 | } |
| 58 | |
| 59 | function isStructuredBatchStepShape(step: unknown): step is Record<string, unknown> & BatchStep { |
| 60 | return isRecord(step) && 'input' in step && !('positionals' in step) && !('flags' in step); |
no test coverage detected
searching dependent graphs…