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

Function formatCsvValue

apps/sim/app/api/table/[tableId]/export/route.ts:127–133  ·  view source on GitHub ↗

* Serializes a cell for CSV. Only string cells are formula-neutralized; numbers, * booleans, dates, and JSON objects can never form a trigger and pass through verbatim.

(value: unknown)

Source from the content-addressed store, hash-verified

125 * booleans, dates, and JSON objects can never form a trigger and pass through verbatim.
126 */
127function formatCsvValue(value: unknown): string {
128 if (value === null || value === undefined) return ''
129 if (value instanceof Date) return value.toISOString()
130 if (typeof value === 'object') return JSON.stringify(value)
131 if (typeof value === 'string') return neutralizeCsvFormula(value)
132 return String(value)
133}
134
135function toCsvRow(values: string[]): string {
136 return values.map(escapeCsvField).join(',')

Callers 1

startFunction · 0.70

Calls 1

neutralizeCsvFormulaFunction · 0.90

Tested by

no test coverage detected