(cols: Column[], rows: unknown[][])
| 116 | ]); |
| 117 | |
| 118 | export default function formatRows(cols: Column[], rows: unknown[][]) { |
| 119 | return rows.map((row) => { |
| 120 | return row.map((cell, idx) => { |
| 121 | const colType = cols[idx].type_oid; |
| 122 | const formatFn = MZ_DATA_TYPE_TO_FORMAT_FN.get(colType); |
| 123 | if (formatFn) { |
| 124 | return formatFn(cell); |
| 125 | } |
| 126 | return formatCellDefault(cell); |
| 127 | }); |
| 128 | }); |
| 129 | } |
| 130 | |
| 131 | function formatCellDefault(cell: unknown) { |
| 132 | if (typeof cell === "string") { |
no test coverage detected