0.0.2 • Published 5 years ago

@knesk/joi v0.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
5 years ago

Knesk Joi · GitHub license

Joi Library Extended (https://github.com/hapijs/joi)

How to Install

npm install @knesk/joi
or
yarn add @knesk/joi

Examples

Check example.js for more examples and run by using command node example.js

Usage

const Joi = require('@knesk/joi')
const schema = {
	user: Joi.objectId(), // Mongo Object ID Validation
};
const value = {
	user: '584ebf8bee8d98127efb080c'  
};
const result = Joi.validate(value, schema);
console.log(result.error) // null
console.log(result.value) // { user: 584ebf8bee8d98127efb080c }
0.0.2

5 years ago