js-data / js-data-schema

Define and validate rules, datatypes and schemata in Node and in the browser.
http://www.js-data.io/docs/js-data-schema
MIT License
18 stars 10 forks source link

List of validator rules #20

Closed mikeerickson closed 7 years ago

mikeerickson commented 7 years ago

Is there a list of built-in validator rules?

I realize I can create custom rules, but no sense in reinventing wheel if they already exist

schemator.defineSchema('Family', {
    fname: {type: 'string', nullable: false},
    lname: {type: 'string', nullable: false},
    email: 'string',
    dob: 'date',
    state: 'string',
    hobbies: 'array',
    gender: 'string',
    married: {type: 'boolean', nullable: false},
    bio: 'string'
});
jmdobry commented 7 years ago

You can get the list of default rules via schemator. availableRulesI()