Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

celebrate

Package Overview
Dependencies
Maintainers
1
Versions
55
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

celebrate - npm Package Compare versions

Comparing version 2.0.0 to 2.1.0

4

lib/index.js

@@ -9,3 +9,3 @@ 'use strict';

module.exports = (schema) => {
module.exports = (schema, options) => {
const result = Joi.validate(schema || {}, validations.schema);

@@ -28,3 +28,3 @@ Assert.ifError(result.error);

Joi.validate(req[source], spec, (err, value) => {
Joi.validate(req[source], spec, options, (err, value) => {
if (value !== undefined) {

@@ -31,0 +31,0 @@ // Apply any Joi transforms back to the request

{
"name": "celebrate",
"version": "2.0.0",
"version": "2.1.0",
"description": "A joi validation middleware for Express.",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

@@ -75,3 +75,3 @@ ![Celebrate](https://github.com/continuationlabs/celebrate/raw/master/images/logo.png)

### `celebrate(schema)`
### `celebrate(schema, [options])`

@@ -81,2 +81,3 @@ Returns a `function` with the middleware signature (`(req, res, next)`).

- `schema` - a object where `key` can be one of `'params', 'headers', 'query', and 'body'` and the `value` is a [joi](https://github.com/hapijs/joi/blob/master/API.md) validation schema. Only the `key`s specified will be validated against the incomming `req` object. If you omit a key, that part of the `req` object will not be validated. A schema must contain at least one of the valid keys.
- `[options]` - `joi` [options](https://github.com/hapijs/joi/blob/master/API.md#validatevalue-schema-options-callback) that are passed directly into the `validate` function.

@@ -83,0 +84,0 @@ ## Order

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc