UNPKG

async-validate

Version:

Asynchronous validation for node and the browser

19 lines (16 loc) 390 B
var expect = require('chai').expect; var email = require('../email') , schema = { type: 'object', fields: { email: [ {type: 'string', required: true}, {type: 'string', pattern: email} ], token: function(cb) { expect(this.source.email).to.be.a('string'); cb(); } } } module.exports = schema;