Skip to content

API reference > @kontsedal/olas-core > maxLength

maxLength() function ​

Reject strings / arrays longer than n.

Signature:

typescript
maxLength: (n: number, message?: string) => Validator<string | readonly unknown[]>

Parameters ​

Parameter

Type

Description

n

number

message

string

(Optional)

Returns:

Validator<string | readonly unknown[]>

Released under the MIT License.