This commit is contained in:
Talor Berthelson
2016-06-17 20:49:15 -04:00
commit 889faf9c1c
699 changed files with 112020 additions and 0 deletions

18
node_modules/is-my-json-valid/example.js generated vendored Normal file
View File

@@ -0,0 +1,18 @@
var validator = require('./')
var validate = validator({
type: 'object',
properties: {
hello: {
required: true,
type: 'string'
}
}
})
console.log('should be valid', validate({hello: 'world'}))
console.log('should not be valid', validate({}))
// get the last error message by checking validate.error
// the following will print "data.hello is required"
console.log('the errors were:', validate.errors)