Skip to content

Function: minLength()

ts
function minLength(min): Validator<string>;

Minimum length validation / 最小长度验证

Parameters

ParameterType
minnumber

Returns

Validator<string>

Example

ts
minLength(3)('ab') // => { isValid: false, message: 'Minimum length is 3 characters / 最小长度为3个字符' }
minLength(3)('abc') // => { isValid: true, message: undefined }

Since

1.0.0

Released under the MIT License.