UNPKG

e-lado

Version:

[![CircleCI](https://circleci.com/gh/sharetribe/sharetribe/tree/master.svg?style=svg)](https://circleci.com/gh/sharetribe/sharetribe/tree/master) [![Dependency Status](https://gemnasium.com/sharetribe/sharetribe.png)](https://gemnasium.com/sharetribe/shar

19 lines (15 loc) 430 B
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)