@wegolook/joi-objectid

6.1.2 • 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

66

Version

6.1.2

License

BSD-3-Clause

Unpacked Size

3.78 kB

Total Files

4

Last publish

Collaborators

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