(text: string, count: number)
| 132 | ) |
| 133 | .trim(); |
| 134 | } |
| 135 | |
| 136 | function splitLongText(text: string, maxLength = MAX_MESSAGE_LENGTH): string[] { |
| 137 | if (text.length <= maxLength) return [text]; |
| 138 | |
| 139 | const chunks: string[] = []; |
| 140 | const lines = text.split("\n"); |
| 141 | let current = ""; |
| 142 | |
| 143 | for (const line of lines) { |
| 144 | const next = current ? `${current}\n${line}` : line; |
| 145 | if (next.length <= maxLength) { |
| 146 | current = next; |
| 147 | continue; |
| 148 | } |
| 149 |
no outgoing calls
no test coverage detected