(
title: string,
items: ReadonlyArray<{ label: string; description: string }>,
)
| 1018 | } |
| 1019 | |
| 1020 | function renderAlignedSection( |
| 1021 | title: string, |
| 1022 | items: ReadonlyArray<{ label: string; description: string }>, |
| 1023 | ): string { |
| 1024 | if (items.length === 0) { |
| 1025 | return `${title}\n (none)`; |
| 1026 | } |
| 1027 | const maxLabelLength = Math.max(...items.map((item) => item.label.length)) + 2; |
| 1028 | const lines = [title]; |
| 1029 | for (const item of items) { |
| 1030 | lines.push(` ${item.label.padEnd(maxLabelLength)}${item.description}`); |
| 1031 | } |
| 1032 | return lines.join('\n'); |
| 1033 | } |
| 1034 | |
| 1035 | function renderTextSection(title: string, lines: ReadonlyArray<string>): string { |
| 1036 | if (lines.length === 0) { |
no test coverage detected