(str: string)
| 21 | } |
| 22 | |
| 23 | function maxLineLength(str: string): number { |
| 24 | return str.split('\n').reduce((max, curr) => Math.max(max, stringWidth(curr)), 0) + 2 |
| 25 | } |
| 26 | |
| 27 | export function drawBox({ title, width, height, str, horizontalPadding }: BoxOptions): string { |
| 28 | // This avoids having NaN later |