MCPcopy Create free account
hub / github.com/HelloCSV/HelloCSV / normalizeValue

Function normalizeValue

src/utils/index.ts:49–62  ·  view source on GitHub ↗
(value: ImporterOutputFieldType)

Source from the content-addressed store, hash-verified

47}
48
49export 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
64function escapeCsvCell(value: ImporterOutputFieldType): string {
65 if (value == null) {

Callers 3

useFilteredRowDataFunction · 0.90
index.test.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected