Skip to content

maxLength

maxLength(dataValue, validatorConfigValue) ⇒ boolean

Check for max string length

Kind: global function

ParamTypeDescription
dataValuestringinput string
validatorConfigValuenumbermax expected value

Example

js
import maxLength from '@hiperf/validate/maxLength';

maxLength('John', 5); // false
maxLength('John', 2); // true