Moko Validators
A plugin that provides a bunch of validators for moko.
Example Usage
var Person = validation = ; Person;
Basic Validators
Required
Verifies that a field is present.
User;
Confirms
Verifies that a field equals another field.
User ;
Type
Checks that a field is of a given type
User;
In addition to string support for primitives, you can also pass in a constructor.
User; // Or User;
Format Validators
Verify the value of a field against a regex pattern. moko-validators
comes with a few regex strings built in under the formatStrings
object.
Format
Validates the field against the given regular expression
User;
Phone Number
Validates the field against a (North American) phone number format
User;
Email Address
Validates the field against a email address format
User;
URL
Validates the field against a URL format
User;
Credit Card
Validates the field against a credit card format.
User;