(value: string, cursor: number)
| 223 | } |
| 224 | |
| 225 | function normalizeInputCursorForward(value: string, cursor: number): number { |
| 226 | const c = clampInputCursor(value, cursor); |
| 227 | if (c === 0 || c === value.length) return c; |
| 228 | |
| 229 | let off = 0; |
| 230 | while (off < value.length) { |
| 231 | const end = nextClusterEnd(value, off); |
| 232 | if (end >= c) return end; |
| 233 | off = end; |
| 234 | } |
| 235 | return value.length; |
| 236 | } |
| 237 | |
| 238 | export type InputSelection = Readonly<{ start: number; end: number }>; |
| 239 |
no test coverage detected