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

Function renderTable

packages/effect/src/unstable/cli/CliOutput.ts:411–415  ·  view source on GitHub ↗
(rows: ReadonlyArray<Row>, widthCap?: number)

Source from the content-addressed store, hash-verified

409 * @internal
410 */
411const renderTable = (rows: ReadonlyArray<Row>, widthCap?: number) => {
412 const maxColumn = Math.max(...rows.map((r) => visualLength(r.left))) + 4
413 const col = widthCap === undefined ? maxColumn : Math.min(maxColumn, widthCap)
414 return rows.map(({ left, right }) => ` ${pad(left, col)}${right}`).join("\n")
415}
416
417const formatSubcommandName = (name: string, alias: string | undefined): string => alias ? `${name}, ${alias}` : name
418

Callers 1

formatHelpDocImplFunction · 0.85

Calls 4

visualLengthFunction · 0.85
padFunction · 0.85
joinMethod · 0.80
mapMethod · 0.45

Tested by

no test coverage detected