MCPcopy
hub / github.com/C4illin/ConvertX / escape

Function escape

src/converters/vcf.ts:52–52  ·  view source on GitHub ↗
(str: string)

Source from the content-addressed store, hash-verified

50 if (!first) return "";
51 const headers = Object.keys(first);
52 const escape = (str: string) => `"${str.replace(/"/g, '""')}"`;
53 const rows = data.map((row) => headers.map((h) => escape(row[h] || "")).join(","));
54 return [headers.join(","), ...rows].join("\n");
55}

Callers 1

toCSVFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected