Below is a list of supported, built-in types for the Obey library
Supports any data type or format
Checks for native type array
Checks for native type boolean
Checks for valid email, includes valid characters, @
separator for address and domain, and valid TLD.
Checks for valid IP Address:
ip
: Default, checks IPv4 formatip:v4
: Checks IPv4 formatip:v6
: Checks IPv6 format
Checks for native type number
Checks for native type object
Checks for valid phone numbers:
phone
: Default, valid with or without separatorsphone:numeric
: Check value for numeric phone number, 7-10 digits
Checks for valid string types:
string
: Default,typeof
should bestring
string:alphanumeric
: Checks value contains only alpha-numeric characters
Checks for valid URL
Checks for valid v4 UUID
Checks for valid zip/postal codes:
zip
: Default, checks generic postal codezip:us
: Checks US zip code formatzip:ca
: Checks Canadian zip code format