digits
Checks that the value consists of ASCII digits 0-9 only. Unlike positive_integer, leading zeros are kept and the output is a string.
Error codes: NOT_DIGITS, FORMAT_ERROR
rules
input
Invaliderrors
{
"otp": "NOT_DIGITS"
}The string form of the value must be one or more digits: "007" gives "007", 7 gives "7".
js
{ zip: 'digits', otp: ['digits', { length_equal: 6 }] }