JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 32834
  • Score
    100M100P100Q154505F
  • License MIT

A MongoDB ObjectId validator for Joi

Package Exports

  • joi-objectid

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (joi-objectid) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

joi-objectid

A MongoDB ObjectId validator for Joi.

Build Status

use

joi-objectid validates that the value is an alphanumeric string of 24 characters in length.

It's used just like you'd use any other Joi type.

var Joi = require('joi');
Joi.objectId = require('joi-objectid')(Joi);

var schema = {
  id: Joi.objectId()
, name: Joi.string().max(100)
, date: Joi.date()
}

Installation

npm install joi-objectid --save

Development

running tests

  • make test

Pebble Technology!

License

MIT