(value: ImporterOutputFieldType)
| 47 | } |
| 48 | |
| 49 | export function normalizeValue(value: ImporterOutputFieldType) { |
| 50 | if (value == null) { |
| 51 | return null; |
| 52 | } |
| 53 | |
| 54 | const charsToRemove = ['_', ' ', '.', '-', '/']; |
| 55 | return value |
| 56 | .toString() |
| 57 | .toLowerCase() |
| 58 | .replace( |
| 59 | new RegExp(charsToRemove.map((char) => `\\${char}`).join('|'), 'g'), |
| 60 | '' |
| 61 | ); |
| 62 | } |
| 63 | |
| 64 | function escapeCsvCell(value: ImporterOutputFieldType): string { |
| 65 | if (value == null) { |
no outgoing calls
no test coverage detected