(rows: DbRow[], fields: DbField[])
| 139 | |
| 140 | /** Serialize rows back to CSV text (header from field.name in field order). */ |
| 141 | export 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) |
no test coverage detected