MCPcopy Index your code
hub / github.com/simstudioai/sim / formatCsvValue

Function formatCsvValue

apps/sim/lib/table/export-format.ts:24–30  ·  view source on GitHub ↗
(value: unknown)

Source from the content-addressed store, hash-verified

22 * booleans, dates, and JSON objects can never form a trigger and pass through verbatim.
23 */
24export 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
32export function toCsvRow(values: string[]): string {
33 return values.map(escapeCsvField).join(',')

Callers 3

resolveInputFilesFunction · 0.90
materializeFunction · 0.90
runTableExportFunction · 0.90

Calls 1

neutralizeCsvFormulaFunction · 0.70

Tested by

no test coverage detected