StringConstraints
Runtime string constraints attached to a string flag/arg schema.
Length bounds are inclusive and measured in UTF-16 code units (String.prototype.length). All fields are optional; an absent field means "no constraint".
- Import:
@kjanat/dreamcli - Export kind: interface
- Declared in:
src/core/schema/string-constraints.ts - Source link:
src/core/schema/string-constraints.ts:19
Signatures
ts
interface StringConstraints {}Members
Properties
maxLength
Inclusive maximum length. Longer values are rejected.
ts
maxLength?: number;minLength
Inclusive minimum length. Shorter values are rejected.
ts
minLength?: number;nonEmpty
Reject empty strings (''). Whitespace-only strings are still accepted; combine with pattern for stricter rules.
ts
nonEmpty?: boolean;pattern
Regular expression the value must match. Tested with RegExp.prototype.test; anchor with ^/$ for full-string matching.
ts
pattern?: RegExp;