(value: any)
| 400 | } |
| 401 | |
| 402 | const formatCSVValue = (value: any): string => { |
| 403 | if (value === null || value === undefined) { |
| 404 | return '' |
| 405 | } |
| 406 | |
| 407 | let stringValue = typeof value === 'object' ? safeConsoleStringify(value) : String(value) |
| 408 | |
| 409 | if (stringValue.includes('"') || stringValue.includes(',') || stringValue.includes('\n')) { |
| 410 | stringValue = `"${stringValue.replace(/"/g, '""')}"` |
| 411 | } |
| 412 | |
| 413 | return stringValue |
| 414 | } |
| 415 | |
| 416 | const headers = [ |
| 417 | 'timestamp', |
no test coverage detected