joi-object-id-extention

A simple JOI extension to verify if strings conform to the objectid(like Mongo) format

Downloads
16
Stars
0
Committers
1

Joi-object-id-extention

This super cool package is a JOI extension that enables you to verify objectIds (like mongo document ids)

Installation

npm install joi-object-id-extention

Usage

const Joi = require('@hapi/joi');
const newJoi = require('joi-object-id-extention');

const schema = Joi.object({
    id: newJoi.string().objectid()
})
Want to make your own?

Check out this blog post. Also feel free to contribute to this repo by raising PRs or creating relevant issues