Skip to content

Ciruxx/joi-extension-objectid

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

joi-extension-objectid

version license

ObjectId extension for the Joi validation library

Usage

const JoiExtensionObjectId = require('@ciruxx/joi-extension-objectid');
const Joi = require('joi').extend(JoiExtensionObjectId);

const schema = Joi.object({
    objectIdKey: Joi.objectId()
});

const validatedData = await schema.validateAsync({
    objectIdKey: "5fd777d57fcb54c356763034"
})

data.objectIdKey instanceof ObjectID // true!

offrex

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published