A joi extension to validate MongoDB's ObjectIDs

Overview

npm version Build Status

@marsup/joi-objectid

This is a simple joi extension to validate MongoDB's ObjectIDs.

Installation

npm install --save @marsup/joi-objectid

Usage

const Joi = require('joi').extend(require('@marsup/joi-objectid'));

Joi.objectId().validate(new ObjectId("aaaaaaaaaaaaaaaaaaaaaaaa")) // Valid => ObjectId("aaaaaaaaaaaaaaaaaaaaaaaa")  
Joi.objectId().validate("aaaaaaaaaaaaaaaaaaaaaaaa") // Valid ObjectId("aaaaaaaaaaaaaaaaaaaaaaaa")
Joi.objectId().strict().validate("aaaaaaaaaaaaaaaaaaaaaaaa") // Invalid
Joi.objectId().strict().validate(new ObjectId("aaaaaaaaaaaaaaaaaaaaaaaa")) // Valid => ObjectId("aaaaaaaaaaaaaaaaaaaaaaaa")  

With Typescript

import BaseJoi from 'joi';
import JoiObjectId from '@marsup/joi-objectid';

const Joi = BaseJoi.extend(JoiObjectId);
Comments
  • Update dependency bson to ^4.7.1

    Update dependency bson to ^4.7.1

    Mend Renovate

    This PR contains the following updates:

    | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | bson | ^4.7.0 -> ^4.7.1 | age | adoption | passing | confidence |


    Release Notes

    mongodb/js-bson

    v4.7.1

    Compare Source

    The MongoDB Node.js team is pleased to announce version v4.7.1 of the bson package!

    Bug Fixes
    • NODE-4905: double precision accuracy in canonical EJSON (#​549) (d86bd52)

    Documentation

    • API: https://github.com/mongodb/js-bson#readme
    • Changelog: https://github.com/mongodb/js-bson/blob/main/HISTORY.md#change-log

    We invite you to try the bson library immediately, and report any issues to the NODE project.


    Configuration

    📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

    🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

    Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

    🔕 Ignore: Close this PR and you won't be reminded about this update again.


    • [ ] If you want to rebase/retry this PR, check this box

    This PR has been generated by Mend Renovate. View repository job log here.

    opened by renovate[bot] 0
  • Update dependency @hapi/lab to ^25.1.0

    Update dependency @hapi/lab to ^25.1.0

    Mend Renovate

    This PR contains the following updates:

    | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | @hapi/lab | ^25.0.1 -> ^25.1.0 | age | adoption | passing | confidence |


    Release Notes

    hapijs/lab

    v25.1.0

    Compare Source


    Configuration

    📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

    🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

    Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

    🔕 Ignore: Close this PR and you won't be reminded about this update again.


    • [ ] If you want to rebase/retry this PR, check this box

    This PR has been generated by Mend Renovate. View repository job log here.

    opened by renovate[bot] 0
  • Update dependency @hapi/code to ^9.0.2

    Update dependency @hapi/code to ^9.0.2

    Mend Renovate

    This PR contains the following updates:

    | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | @hapi/code | ^9.0.1 -> ^9.0.2 | age | adoption | passing | confidence |


    Release Notes

    hapijs/code

    v9.0.2

    Compare Source


    Configuration

    📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

    🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

    Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

    🔕 Ignore: Close this PR and you won't be reminded about this update again.


    • [ ] If you want to rebase/retry this PR, check this box

    This PR has been generated by Mend Renovate. View repository job log here.

    opened by renovate[bot] 0
  • Update dependency joi to ^17.7.0

    Update dependency joi to ^17.7.0

    Mend Renovate

    This PR contains the following updates:

    | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | joi | ^17.6.4 -> ^17.7.0 | age | adoption | passing | confidence |


    Release Notes

    hapijs/joi

    v17.7.0

    Compare Source


    Configuration

    📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

    🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

    Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

    🔕 Ignore: Close this PR and you won't be reminded about these updates again.


    • [ ] If you want to rebase/retry this PR, check this box

    This PR has been generated by Mend Renovate. View repository job log here.

    opened by renovate[bot] 0
  • Update dependency joi to ^17.6.4

    Update dependency joi to ^17.6.4

    Mend Renovate

    This PR contains the following updates:

    | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | joi | ^17.6.3 -> ^17.6.4 | age | adoption | passing | confidence |


    Release Notes

    hapijs/joi

    v17.6.4

    Compare Source


    Configuration

    📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

    🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

    Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

    🔕 Ignore: Close this PR and you won't be reminded about these updates again.


    • [ ] If you want to rebase/retry this PR, click this checkbox.

    This PR has been generated by Mend Renovate. View repository job log here.

    opened by renovate[bot] 0
  • Update dependency joi to ^17.6.3

    Update dependency joi to ^17.6.3

    Mend Renovate

    This PR contains the following updates:

    | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | joi | ^17.6.2 -> ^17.6.3 | age | adoption | passing | confidence |


    Release Notes

    hapijs/joi

    v17.6.3

    Compare Source


    Configuration

    📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

    🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

    Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

    🔕 Ignore: Close this PR and you won't be reminded about these updates again.


    • [ ] If you want to rebase/retry this PR, click this checkbox.

    This PR has been generated by Mend Renovate. View repository job log here.

    opened by renovate[bot] 0
  • Update dependency joi to ^17.6.2

    Update dependency joi to ^17.6.2

    Mend Renovate

    This PR contains the following updates:

    | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | joi | ^17.6.1 -> ^17.6.2 | age | adoption | passing | confidence |


    Release Notes

    hapijs/joi

    v17.6.2

    Compare Source


    Configuration

    📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

    🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

    Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

    🔕 Ignore: Close this PR and you won't be reminded about these updates again.


    • [ ] If you want to rebase/retry this PR, click this checkbox.

    This PR has been generated by Mend Renovate. View repository job log here.

    opened by renovate[bot] 0
  • Update dependency joi to ^17.6.1

    Update dependency joi to ^17.6.1

    Mend Renovate

    This PR contains the following updates:

    | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | joi | ^17.6.0 -> ^17.6.1 | age | adoption | passing | confidence |


    Release Notes

    hapijs/joi

    v17.6.1

    Compare Source


    Configuration

    📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

    🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

    Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

    🔕 Ignore: Close this PR and you won't be reminded about these updates again.


    • [ ] If you want to rebase/retry this PR, click this checkbox.

    This PR has been generated by Mend Renovate. View repository job log here.

    opened by renovate[bot] 0
  • Update dependency bson to ^4.7.0

    Update dependency bson to ^4.7.0

    Mend Renovate

    This PR contains the following updates:

    | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | bson | ^4.6.5 -> ^4.7.0 | age | adoption | passing | confidence |


    Release Notes

    mongodb/js-bson

    v4.7.0

    Compare Source

    Features
    4.6.5 (2022-07-07)
    Bug Fixes
    • NODE-3630: remove float parser and test edge cases for Double (#​502) (54ca603)
    • NODE-4211: Do not require crypto in browser builds (#​500) (b32ab40)
    • NODE-4302: remove downlevel ts and typesVersions (#​501) (651b60e)
    • NODE-4381: handle __proto__ well in EJSON (#​506) (4bda57d)
    4.6.4 (2022-05-19)
    4.6.3 (2022-04-20)
    4.6.2 (2022-03-22)
    Bug Fixes
    • MONGOSH-1155: update error message in ObjectId class (#​493) (67fbc7c)
    • NODE-3015: ObjectId.equals should use Buffer.equals for better performance (#​478) (8305bdf)
    • NODE-3962: correct type for ObjectiId._bsontype (#​480) (9671773)
    4.6.1 (2022-01-06)
    Bug Fixes
    • NODE-3760: ObjectId.isValid string and byte length match (#​475) (187d1c4)
    • NODE-3815: update Decimal128 constructor validation (#​476) (95e8293)
    • NODE-3821: nullish check before using toBSON override function (#​477) (1d898b6)

    Configuration

    📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

    🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

    Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

    🔕 Ignore: Close this PR and you won't be reminded about this update again.


    • [ ] If you want to rebase/retry this PR, check this box

    This PR has been generated by Mend Renovate. View repository job log here.

    opened by renovate[bot] 0
  • Update dependency bson to ^4.6.5

    Update dependency bson to ^4.6.5

    Mend Renovate

    This PR contains the following updates:

    | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | bson | ^4.6.4 -> ^4.6.5 | age | adoption | passing | confidence |


    Release Notes

    mongodb/js-bson

    v4.6.5

    Compare Source


    Configuration

    📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

    🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

    Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

    🔕 Ignore: Close this PR and you won't be reminded about this update again.


    • [ ] If you want to rebase/retry this PR, click this checkbox.

    This PR has been generated by Mend Renovate. View repository job log here.

    opened by renovate[bot] 0
  • Update dependency @hapi/code to ^9.0.1

    Update dependency @hapi/code to ^9.0.1

    Mend Renovate

    This PR contains the following updates:

    | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | @hapi/code | ^9.0.0 -> ^9.0.1 | age | adoption | passing | confidence |


    Release Notes

    hapijs/code

    v9.0.1

    Compare Source


    Configuration

    📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

    🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

    Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

    🔕 Ignore: Close this PR and you won't be reminded about this update again.


    • [ ] If you want to rebase/retry this PR, click this checkbox.

    This PR has been generated by Mend Renovate. View repository job log here.

    opened by renovate[bot] 0
  • Dependency Dashboard

    Dependency Dashboard

    This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

    This repository currently has no open or pending branches.

    Detected dependencies

    npm
    package.json
    • bson ^4.7.1
    • @hapi/code ^9.0.2
    • @hapi/lab ^25.1.0
    • joi ^17.7.0
    • joi ^17.7.0

    • [ ] Check this box to trigger a request for Renovate to run again on this repository
    opened by renovate[bot] 0
Owner
Nicolas Morel
Nicolas Morel
Firebase Extension to automatically push Firestore documents to Typesense for full-text search with typo tolerance, faceting, and more

Firestore / Firebase Typesense Search Extension ⚡ ?? A Firebase extension to sync data from your Firestore collection to Typesense, to be able to do f

Typesense 101 Dec 28, 2022
GraphQL extension for coc.nvim

GraphQL extension for coc.nvim

yaegassy 7 Sep 4, 2022
🦩 Joi like validations for TypeScript

?? Computed Types Runtime validation types for TypeScript. Computed-Types (formerly: Funval) is a strongly-typed validation library for TypeScript. Us

Neuledge 338 Jan 4, 2023
Prisma 2+ generator to emit Joi schemas from your Prisma schema

Prisma Joi Generator Automatically generate Joi schemas from your Prisma Schema, and use them to validate your API endpoints or any other use you have

Omar Dulaimi 26 Dec 24, 2022
Validate directory structure and file contents with an extension of JSON schema.

directory-schema-validator Description Validate directory structure and file contents with an extension of JSON schema. Install Install using NPM or s

Justin Poehnelt 5 Nov 1, 2022
Parse, validate, manipulate, and display dates in javascript.

Moment.js A JavaScript date library for parsing, validating, manipulating, and formatting dates. Project Status Moment.js is a legacy project, now in

Moment.js 47.1k Jan 2, 2023
Validate your forms, frontend, without writing a single line of javascript

Parsley JavaScript form validation, without actually writing a single line of JavaScript! Version 2.9.2 Doc See index.html and doc/ Requirements jQuer

Guillaume Potier 9k Dec 27, 2022
A web-based tool to view, edit, format, and validate JSON

JSON Editor JSON Editor is a web-based tool to view, edit, format, and validate JSON. It has various modes such as a tree editor, a code editor, and a

Jos de Jong 10.1k Jan 4, 2023
The best @jquery plugin to validate form fields. Designed to use with Bootstrap + Zurb Foundation + Pure + SemanticUI + UIKit + Your own frameworks.

FormValidation - Download http://formvalidation.io - The best jQuery plugin to validate form fields, designed to use with: Bootstrap Foundation Pure S

FormValidation 2.8k Mar 29, 2021
[DISCONTINUED] jQuery plugin that makes it easy to validate user input while keeping your HTML markup clean from javascript code.

jQuery Form Validator [DISCONTINUED] Validation framework that let's you configure, rather than code, your validation logic. I started writing this pl

Victor Jonsson 976 Dec 30, 2022
jQuery library to validate html forms. compatible with bootstrap v4 and bootstrap v3

jQuery form validation jQuery form validation is a library that helps you to validate your HTML form, it's completable with both Bootstrap 3 and Boots

Bassam Nabriss 33 Jun 10, 2021
A simple and composable way to validate data in JavaScript (and TypeScript).

A simple and composable way to validate data in JavaScript (and TypeScript). Usage • Why? • Principles • Demo • Examples • Documentation Superstruct m

Ian Storm Taylor 6.3k Jan 9, 2023
Validate properties and well known annotations in your Backstage catalog-info.yaml files.

Backstage entity validator This package can be used as a GitHub action or a standalone node.js module GitHub action Inputs path Optional Path to the c

Roadie 39 Dec 26, 2022
Validate for XML schema and returns all the possible failures

detailed-xml-validator Validate for XML schema and returns all the possible failures Sample Rules file <?xml version = "1.0"?> <students nillable="fa

Natural Intelligence 11 Dec 20, 2022
This Login Form made using React hooks , React Js , Css, Json. This form have 3 inputs, it also validate those inputs & it also having length limitations.

Getting Started with Create React App This project was bootstrapped with Create React App. Available Scripts In the project directory, you can run: np

Yogesh Sharma 0 Jan 3, 2022
Check EU Digitial Covid Certificates with ease and validate them against country and local rules.

Check EU Digitial Covid Certificates with ease and validate them against local or country rules. What is the purpose of CovidValidator? CovidValidator

Timo Koenig 10 Mar 14, 2022
Validate graphql operations against a schema

@graphql-validate With the power of GraphQL-Tools and GraphQL-JS, we are able to provide a smooth experience for validation your GraphQL operations du

Saihajpreet Singh 13 Dec 23, 2022
JSON Struct is a vocabulary that allows you to annotate and validate JSON documents.

JSON-Struct JSON Struct is a vocabulary that allows you to annotate and validate JSON documents. Examples Basic This is a simple example of vocabulary

Saman 3 May 8, 2022
A library for validate a string using regular expressions.

Fogex Form Regex Quickly and easily check if the content is valid. Installation npm install fogex or yarn add fogex Usage import fogex from 'fogex';

null 5 May 5, 2022
BHIMUPIJS is a npm module which can validate, verify and generate QR Codes for UPI IDs.

bhimupijs BHIMUPIJS is a npm module which can validate, verify and generate QR Codes for UPI IDs. Installation Install this npm package globally. npm

Emmadi Sumith Kumar 18 Nov 21, 2022