(data: any, key?: string, indent?: number)
| 10 | }; |
| 11 | |
| 12 | export const stringify = (data: any, key?: string, indent?: number): string => { |
| 13 | // For comment fields, use pretty-print formatting for better readability |
| 14 | // Other fields use compact format to reduce file size, unless an explicit |
| 15 | // indent is requested by the caller (e.g. human-readable trace downloads). |
| 16 | const resolvedIndent = indent ?? (key === "comments" ? 2 : undefined); |
| 17 | |
| 18 | return JSON.stringify(data, stringifyReplacer, resolvedIndent); |
| 19 | }; |
| 20 | |
| 21 | /** |
| 22 | * CSV-specific stringify that returns strings as-is instead of JSON-encoding them. |
no test coverage detected
searching dependent graphs…