Created
September 17, 2012 21:51
-
-
Save ovaillancourt/3740015 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var user = { | |
name : [ purity.isString ], //Simple validation that the | |
//name is a string. | |
email : [ purity.trim, purity.isString, purity.isEmail ], | |
age : [ purity.isNumber, purity.greater(0), purity.toInt ], | |
//Array of friends | |
friends : [{ | |
nickname: [purity.isString] | |
}], | |
comments : [], //Free-form field, anything can go in there. | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment