(title: string)
| 88 | } |
| 89 | |
| 90 | const limit = Math.max(1, maxLength - 3); |
| 91 | const sliced = value.slice(0, limit); |
| 92 | const boundary = Math.max( |
| 93 | sliced.lastIndexOf(' '), |
| 94 | sliced.lastIndexOf(','), |
| 95 | sliced.lastIndexOf('。'), |
| 96 | sliced.lastIndexOf(','), |
| 97 | sliced.lastIndexOf('.') |
| 98 | ); |
| 99 | const candidate = boundary >= Math.floor(limit * 0.6) ? sliced.slice(0, boundary) : sliced; |
no test coverage detected