API reference > @kontsedal/olas-core > minLength
minLength() function
Reject strings / arrays shorter than n. Allows null/undefined (use with required to forbid).
Signature:
typescript
minLength: (n: number, message?: string) => Validator<string | readonly unknown[]>Parameters
Parameter | Type | Description |
|---|---|---|
n | number | |
message | string | (Optional) |
Returns:
Validator<string | readonly unknown[]>