Sha256: 24b61530e39958af5226a30c772b69592899c8667b59c836141ea307389f5075
Contents?: true
Size: 430 Bytes
Versions: 44
Compression:
Stored size: 430 Bytes
Contents
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)
Version data entries
44 entries across 39 versions & 12 rubygems