Default rules
required
If the value contains any value, it returns true
.
It also returns false
for an empty array, empty object, undefined
and null
.
empty
If there is no value in the value, it returns true
.
However, if the value is null
, it returns false
.
regexp
Returns the result of testing the value with an `option.test`.
email
If value is a valid email address, it returns true
.
list
If the value exists in the option.list
, it returns true
.
number
If the value is a number
, it returns true
.
integer
If the value is an integer, it returns true
.
naturalNumber
If the value is a natural number, it returns true
.
positiveNumber
If the value is positive, it returns true
.
If value is 0
, it returns false
.
negativeNumber
If the value is negative, it returns true
.
If value is 0
, it returns false
.
zero
If value is 0
, it returns true
.
age
If the value is a valid age value, it returns true
.
equal
If the value matches the value specified in option.others
, it returns true
.
letters
If the value is a number in the specified range, it returns true
.
Last updated