| LCOV - code coverage report | ||||||||||||||||||
|
||||||||||||||||||
Line data Source code 1 160 : export function splitTextAtWordBoundary( 2 : text: string, 3 : ratio: number 4 : ): [string, string] { 5 160 : if (ratio >= 1) return [text, ''] 6 160 : const estimate = Math.floor(text.length * ratio) 7 160 : const before = text.lastIndexOf(' ', estimate) 8 160 : const breakIndex = before > 0 ? before : text.indexOf(' ') 9 160 : if (breakIndex <= 0) return [text, ''] 10 156 : return [text.substring(0, breakIndex), text.substring(breakIndex + 1)] 11 : } |
| Generated by: LCOV version 2.0-1 |