Function
parseJsonFileContent
(content: string, path: string)
Source from the content-addressed store, hash-verified
| 122 | } |
| 123 | |
| 124 | export function parseJsonFileContent(content: string, path: string): unknown { |
| 125 | try { |
| 126 | return JSON.parse(content) as unknown; |
| 127 | } catch (error) { |
| 128 | const message = error instanceof Error ? error.message : String(error); |
| 129 | throw new Error(`Invalid JSON in ${path}: ${message}`); |
| 130 | } |
| 131 | } |
| 132 | |
| 133 | export function stringifyJsonFileContent( |
| 134 | value: unknown, |
Tested by
no test coverage detected