(value: string, width: number)
| 761 | } |
| 762 | |
| 763 | function wrapText(value: string, width: number) { |
| 764 | const lines: string[] = [] |
| 765 | |
| 766 | for (const rawLine of value.split("\n")) { |
| 767 | let line = rawLine |
| 768 | |
| 769 | if (!line) { |
| 770 | lines.push("") |
| 771 | continue |
| 772 | } |
| 773 | |
| 774 | while (line.length > width) { |
| 775 | let breakAt = line.lastIndexOf(" ", width) |
| 776 | if (breakAt < width * 0.5) { |
| 777 | breakAt = width |
| 778 | } |
| 779 | |
| 780 | lines.push(line.slice(0, breakAt).trimEnd()) |
| 781 | line = line.slice(breakAt).trimStart() |
| 782 | } |
| 783 | |
| 784 | lines.push(line) |
| 785 | } |
| 786 | |
| 787 | return lines |
| 788 | } |
| 789 | |
| 790 | function parseInlineMarkdown(value: string): TranscriptPart[] { |
| 791 | const parts: TranscriptPart[] = [] |
no outgoing calls
no test coverage detected