MCPcopy Index your code
hub / github.com/callstack/agent-device / readLegacyCliBatchStep

Function readLegacyCliBatchStep

src/cli/batch-steps.ts:75–90  ·  view source on GitHub ↗
(step: unknown, stepNumber: number)

Source from the content-addressed store, hash-verified

73}
74
75function 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
92function readLegacyCommand(value: unknown, stepNumber: number): CommandName {
93 const command = typeof value === 'string' ? value.trim().toLowerCase() : '';

Callers 1

normalizeCliBatchStepsFunction · 0.85

Calls 6

isRecordFunction · 0.90
parseBatchStepRuntimeFunction · 0.90
readLegacyCommandFunction · 0.85
readLegacyPositionalsFunction · 0.85
readLegacyFlagsFunction · 0.85

Tested by

no test coverage detected