@wegolook/joi-objectid

6.1.0 • Public • Published

@wegolook/joi-objectid

Joi extension to support BSON ObjectId

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) => { /*...*/ });

CI Status

Codeship Status for wegolook/joi-objectid

Package Sidebar

Install

npm i @wegolook/joi-objectid

Weekly Downloads

162

Version

6.1.0

License

BSD-3-Clause

Unpacked Size

3.69 kB

Total Files

4

Last publish

Collaborators

  • mmcnees-wgl
  • joe.hayden
  • dhanarayappan
  • madhurprimus
  • ipshu
  • wegolookdev
  • jfrench
  • trobeson
  • pat_rich
  • xsvc_integrations
  • devonlucey
  • rishabhprimus