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

Function normalizeCliBatchSteps

src/cli/batch-steps.ts:30–44  ·  view source on GitHub ↗
(steps: unknown[])

Source from the content-addressed store, hash-verified

28}
29
30function normalizeCliBatchSteps(steps: unknown[]): BatchStep[] {
31 let sawLegacyStep = false;
32 const normalized = steps.map((step, index) => {
33 if (isStructuredBatchStepShape(step)) return readStructuredBatchStep(step, index + 1);
34 const legacyStep = readLegacyCliBatchStep(step, index + 1);
35 sawLegacyStep = true;
36 return legacyStepToStructuredStep(legacyStep);
37 });
38 if (sawLegacyStep) {
39 process.stderr.write(
40 'Warning: batch steps using positionals/flags are deprecated and will be removed in the next major version. Use {"command":"...","input":{...}} steps instead.\n',
41 );
42 }
43 return normalized;
44}
45
46function legacyStepToStructuredStep(legacyStep: LegacyCliBatchStep): BatchStep {
47 const input = readInputFromCli(

Callers 1

readCliBatchStepsJsonFunction · 0.85

Calls 5

readStructuredBatchStepFunction · 0.85
readLegacyCliBatchStepFunction · 0.85
writeMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…