MCPcopy Create free account
hub / github.com/ZenNotes/zennotes / serializeRows

Function serializeRows

packages/shared-domain/src/database-csv.ts:141–145  ·  view source on GitHub ↗
(rows: DbRow[], fields: DbField[])

Source from the content-addressed store, hash-verified

139
140/** Serialize rows back to CSV text (header from field.name in field order). */
141export function serializeRows(rows: DbRow[], fields: DbField[]): string {
142 const header = fields.map((f) => f.name)
143 const body = rows.map((row) => fields.map((f) => row.cells[f.id] ?? ''))
144 return serializeCsv([header, ...body])
145}
146
147// ---------------------------------------------------------------------------
148// Inference (opening a CSV that has no sidecar yet)

Callers 10

DatabaseViewFunction · 0.90
readDatabaseFunction · 0.90
writeDatabaseRowsFunction · 0.90
writeDatabaseSchemaFunction · 0.90
createDatabaseFunction · 0.90
openDatabaseFunction · 0.90
writeDatabaseRowsFunction · 0.90
writeDatabaseSchemaFunction · 0.90
createDatabaseFunction · 0.90

Calls 1

serializeCsvFunction · 0.85

Tested by

no test coverage detected