fn
guessValidValueByPattern
testedConform a value to an array mask slot-by-slot: auto-insert fixed characters, accept matcher slots one character at a time, drop characters that don't fit, and track the caret in masked-output coordinates.
Signature
ts
export function guessValidValueByPattern(
state: ElementState,
mask: ReadonlyArray<RegExp | string>,
): ElementState{ ... }Parameters
| Parameter | Type | Description |
|---|---|---|
state | ElementState | — |
mask | ReadonlyArray<RegExp | string> | — |
Returns
ElementState| Property | Type | Description |
|---|---|---|
value | string | — |
selection | SelectionRange | — |