Skip to content

BrandedEntertainmentNetwork/joi-objectid

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

#joi-objectid

This npm package is intended to allow Joi to validate BSON ObjectId objects

usage

// import and assignment
const Joi = require('joi'); // use version ^9.0.0
const joiObjectId = require('@wegolook/joi-objectid');
const myJoi = Joi.extend(joiObjectId);

// ...then
const result = myJoi.objectId().validate(myObjectId);
// result.value, result.errors, etc...

// ...or
myJoi.objectId().validate(myObjectId, (err, value) => { /*...*/ });

About

Extends Joi with Joi.objectId()

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages

  • JavaScript 100.0%