Skip to content

Instantly share code, notes, and snippets.

@big-kahuna-burger
Last active June 13, 2017 13:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save big-kahuna-burger/b2a741d40dbe25f9190d5fb84aafb18c to your computer and use it in GitHub Desktop.
Save big-kahuna-burger/b2a741d40dbe25f9190d5fb84aafb18c to your computer and use it in GitHub Desktop.
var Ajv = require('ajv')
var ajv = require('ajv-async')(new Ajv())
//schema configuration here
module.exports = function(schema, object, cb){
return ajv.validate(schema, object)
.then(function (value) {
cb(null, value)
}, cb)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment