(value: unknown)
| 22 | * booleans, dates, and JSON objects can never form a trigger and pass through verbatim. |
| 23 | */ |
| 24 | export function formatCsvValue(value: unknown): string { |
| 25 | if (value === null || value === undefined) return '' |
| 26 | if (value instanceof Date) return value.toISOString() |
| 27 | if (typeof value === 'object') return JSON.stringify(value) |
| 28 | if (typeof value === 'string') return neutralizeCsvFormula(value) |
| 29 | return String(value) |
| 30 | } |
| 31 | |
| 32 | export function toCsvRow(values: string[]): string { |
| 33 | return values.map(escapeCsvField).join(',') |
no test coverage detected