Function
parseStructuredEnvelope
(
stdout: string,
label: string,
)
Source from the content-addressed store, hash-verified
| 93 | } |
| 94 | |
| 95 | function parseStructuredEnvelope( |
| 96 | stdout: string, |
| 97 | label: string, |
| 98 | ): NonNullable<SnapshotResult['structuredEnvelope']> { |
| 99 | try { |
| 100 | return JSON.parse(stdout) as NonNullable<SnapshotResult['structuredEnvelope']>; |
| 101 | } catch (error) { |
| 102 | const message = error instanceof Error ? error.message : String(error); |
| 103 | throw new Error(`Failed to parse CLI JSON output for ${label}: ${message}`); |
| 104 | } |
| 105 | } |
| 106 | |
| 107 | export function resolveCliJsonSnapshotErrorState( |
| 108 | status: number | null, |
Tested by
no test coverage detected