(rawTitle: string, normalizedTitle: string)
| 96 | sliced.lastIndexOf(','), |
| 97 | sliced.lastIndexOf('。'), |
| 98 | sliced.lastIndexOf(','), |
| 99 | sliced.lastIndexOf('.') |
| 100 | ); |
| 101 | const candidate = boundary >= Math.floor(limit * 0.6) ? sliced.slice(0, boundary) : sliced; |
| 102 | return `${candidate.trimEnd()}...`; |
| 103 | } |
| 104 | |
| 105 | function sliceAtCompleteCodePointBoundary(value: string, maxLength: number): string { |
| 106 | let end = 0; |
| 107 | for (const character of value) { |
| 108 | if (end + character.length > maxLength) { |
no test coverage detected