https://github.com/shubhamzanwar/joi-object-id-extention
A simple JOI extension to verify if strings conform to the objectid(like Mongo) format
https://github.com/shubhamzanwar/joi-object-id-extention
joi portfolio
Last synced: 6 months ago
JSON representation
A simple JOI extension to verify if strings conform to the objectid(like Mongo) format
- Host: GitHub
- URL: https://github.com/shubhamzanwar/joi-object-id-extention
- Owner: shubhamzanwar
- Created: 2019-06-27T15:42:58.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2022-12-03T15:32:07.000Z (almost 3 years ago)
- Last Synced: 2024-10-11T20:18:46.930Z (12 months ago)
- Topics: joi, portfolio
- Language: JavaScript
- Homepage:
- Size: 320 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 11
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Joi-object-id-extention
This super cool package is a JOI extension that enables you to verify objectIds (like mongo document ids)
## Installation
```shell
npm install joi-object-id-extention
```## Usage
```javascript
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](https://medium.com/@zanwar.shubham/creating-your-first-joi-extension-b8f810073e15). Also feel free to contribute to this repo by raising PRs or creating relevant issues