(text: string)
| 526 | }; |
| 527 | |
| 528 | const splitMarkdownSections = (text: string): string[] => { |
| 529 | const sections = text.split(/\n(?=#+\s)/).map((s) => s.trim()).filter(Boolean); |
| 530 | return sections.length ? sections : [text.trim()]; |
| 531 | }; |
| 532 | |
| 533 | const truncateBySections = (text: string, maxLen: number): { text: string; dropped: number } => { |
| 534 | if (text.length <= maxLen) return { text, dropped: 0 }; |
no outgoing calls
no test coverage detected