(value: ImporterOutputFieldType)
| 62 | } |
| 63 | |
| 64 | function escapeCsvCell(value: ImporterOutputFieldType): string { |
| 65 | if (value == null) { |
| 66 | return ''; |
| 67 | } |
| 68 | |
| 69 | let cell = String(value); |
| 70 | |
| 71 | cell = cell.replace(/"/g, '""'); |
| 72 | |
| 73 | if (/[",\n\r]/.test(cell)) { |
| 74 | cell = `"${cell}"`; |
| 75 | } |
| 76 | |
| 77 | return cell; |
| 78 | } |
| 79 | |
| 80 | export function generateCsvContent( |
| 81 | sheetDefinition: SheetDefinition, |
no outgoing calls
no test coverage detected