(root: Record<string, unknown>)
| 28 | } |
| 29 | |
| 30 | function stringifyJsonc(root: Record<string, unknown>): string { |
| 31 | const rendered = stringify(root, null, 2); |
| 32 | if (typeof rendered !== "string") { |
| 33 | throw new Error("Failed to serialize config JSONC"); |
| 34 | } |
| 35 | return `${rendered}\n`; |
| 36 | } |
| 37 | |
| 38 | /** Pretty-print a new JSONC object. Existing files should use patch helpers to preserve comments. */ |
| 39 | export function formatJsonc(value: unknown): string { |
no outgoing calls
no test coverage detected