(json: string)
| 1019 | |
| 1020 | /** Parse and validate a repro bundle from JSON text. */ |
| 1021 | export function parseReproBundleJson(json: string): ReproParseResult<ReproBundle> { |
| 1022 | let parsed: unknown; |
| 1023 | try { |
| 1024 | parsed = JSON.parse(json); |
| 1025 | } catch (error) { |
| 1026 | const detail = error instanceof Error ? error.message : "invalid JSON"; |
| 1027 | return fail("ZR_REPRO_INVALID_JSON", "$", detail); |
| 1028 | } |
| 1029 | return validateReproBundle(parsed); |
| 1030 | } |
| 1031 | |
| 1032 | /** Parse and validate a repro bundle from UTF-8 JSON bytes. */ |
| 1033 | export function parseReproBundleBytes(bytes: Uint8Array): ReproParseResult<ReproBundle> { |
no test coverage detected