MCPcopy Create free account
hub / github.com/callstack/agent-device / readCliBatchStepsJson

Function readCliBatchStepsJson

src/cli/batch-steps.ts:17–28  ·  view source on GitHub ↗
(raw: string)

Source from the content-addressed store, hash-verified

15};
16
17export 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
30function normalizeCliBatchSteps(steps: unknown[]): BatchStep[] {
31 let sawLegacyStep = false;

Callers 1

readBatchStepsFunction · 0.90

Calls 2

normalizeCliBatchStepsFunction · 0.85
parseMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…