(value: string, cursor: number)
| 195 | } |
| 196 | |
| 197 | function clampInputCursor(value: string, cursor: number): number { |
| 198 | let c = cursor; |
| 199 | if (!Number.isFinite(c)) c = 0; |
| 200 | if (c < 0) c = 0; |
| 201 | if (c > value.length) c = value.length; |
| 202 | return c; |
| 203 | } |
| 204 | |
| 205 | /** |
| 206 | * Normalize cursor position to a valid grapheme cluster boundary. |
no outgoing calls
no test coverage detected