MCPcopy Create free account
hub / github.com/Effect-TS/effect / printTable

Function printTable

packages/effect/typeperf/run.mjs:106–128  ·  view source on GitHub ↗
(rows)

Source from the content-addressed store, hash-verified

104const formatNumber = (n) => n.toLocaleString("en-US")
105
106const printTable = (rows) => {
107 const table = [
108 ["suite", "fixture", "instDelta", "instMax", "typesDelta", "typesMax", "symbolsDelta", "status"],
109 ...rows.map((row) => [
110 row.suite,
111 row.fixture,
112 formatNumber(row.delta.instantiations),
113 row.maxInstantiationsDelta === undefined ? "-" : formatNumber(row.maxInstantiationsDelta),
114 formatNumber(row.delta.types),
115 row.maxTypesDelta === undefined ? "-" : formatNumber(row.maxTypesDelta),
116 formatNumber(row.delta.symbols),
117 row.status
118 ])
119 ]
120 const widths = table[0].map((_, index) => Math.max(...table.map((row) => row[index].length)))
121 for (const [index, row] of table.entries()) {
122 const line = row.map((cell, cellIndex) => cell.padEnd(widths[cellIndex])).join(" ")
123 console.log(line)
124 if (index === 0) {
125 console.log(widths.map((width) => "-".repeat(width)).join(" "))
126 }
127 }
128}
129
130const config = readJson(configPath)
131const selectedTarget = targets[0]

Callers 1

run.mjsFile · 0.70

Calls 4

joinMethod · 0.80
formatNumberFunction · 0.70
logMethod · 0.65
mapMethod · 0.45

Tested by

no test coverage detected