(raw: string, source: string)
| 88 | } |
| 89 | |
| 90 | function parseJson(raw: string, source: string): unknown { |
| 91 | try { |
| 92 | return JSON.parse(raw); |
| 93 | } catch (error: unknown) { |
| 94 | throw new BatchRenderInputError("Invalid JSON in --batch", `${source}: ${errorMessage(error)}`); |
| 95 | } |
| 96 | } |
| 97 | |
| 98 | export function parseBatchRows(raw: string, source: string): Record<string, unknown>[] { |
| 99 | const parsed = parseJson(raw, source); |
no test coverage detected