MCPcopy Create free account
hub / github.com/MaterializeInc/materialize / formatRows

Function formatRows

console/src/platform/shell/formatRows.ts:118–129  ·  view source on GitHub ↗
(cols: Column[], rows: unknown[][])

Source from the content-addressed store, hash-verified

116]);
117
118export 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
131function formatCellDefault(cell: unknown) {
132 if (typeof cell === "string") {

Callers 4

formatRows.test.tsFile · 0.85
downloadCsvFunction · 0.85
copyMarkdownFunction · 0.85
CommandResultFunction · 0.85

Calls 3

formatCellDefaultFunction · 0.85
mapMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected