(cells: string[])
| 122 | |
| 123 | const widths = header.map((h, i) => Math.max(h.length, ...rows.map((r) => r[i]!.length))); |
| 124 | const formatRow = (cells: string[]): string => |
| 125 | cells.map((cell, i) => cell + ' '.repeat(Math.max(0, widths[i]! - cell.length))).join(' '); |
| 126 | |
| 127 | const lines = [chalk.bold(formatRow(header)), ...rows.map(formatRow)]; |
| 128 | return `${lines.join('\n')}\n`; |