Skip to content

muftjs/joi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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 }

About

A Extended version of hapi Joi Library

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published