Skip to content

StringConstraintViolation ​

A failed string constraint, discriminated by which rule was violated.

minLength / maxLength carry the offending bound and pattern carries the source so callers can render them.

Signatures ​

ts
type StringConstraintViolation = { kind: "nonEmpty"; } | { bound: number; kind: "minLength"; } | { bound: number; kind: "maxLength"; } | { kind: "pattern"; pattern: string; };

See Also ​

Released under the MIT License.