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

celebrate

Package Overview
Dependencies
Maintainers
2
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 4.0.3 to 5.0.0

6

lib/index.d.ts

@@ -18,7 +18,11 @@ import { ErrorRequestHandler, RequestHandler } from 'express';

/**
* Creates a Celebrate error handler middleware function
* Creates a Celebrate error handler middleware function.
*/
function errors(): ErrorRequestHandler;
/**
* The Joi version Celebrate uses internally.
*/
export const Joi: object;
}
export = Celebrate;

@@ -78,3 +78,7 @@ 'use strict';

for (var i = 0; i < err.details.length; i++) {
error.validation.keys.push(EscapeHtml(err.details[i].path));
// Disabling because the only way to get this is to fake the Joi response which I don't feel like doing
/* $lab:coverage:off$ */
const path = Array.isArray(err.details[i].path) ? err.details[i].path.join('.') : err.details[i].path;
/* $lab:coverage:on$ */
error.validation.keys.push(EscapeHtml(path));
}

@@ -90,2 +94,4 @@ }

Celebrate.Joi = Joi;
module.exports = Celebrate;

9

package.json
{
"name": "celebrate",
"version": "4.0.3",
"version": "5.0.0",
"description": "A joi validation middleware for Express.",

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

"escape-html": "1.0.3",
"fastseries": "1.7.2"
"fastseries": "1.7.2",
"joi": "11.x.x"
},
"peerDependencies": {
"joi": "10.x.x"
},
"devDependencies": {

@@ -38,3 +36,2 @@ "@types/express": "4.x.x",

"code": "4.x.x",
"joi": "10.x.x",
"lab": "14.x.x"

@@ -41,0 +38,0 @@ },

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

const BodyParser = require('body-parser');
const Joi = require('joi');
const Celebrate = require('celebrate');
const { Joi } = Celebrate;

@@ -48,4 +48,4 @@ const app = express();

const express = require('express');
const Joi = require('joi');
const Celebrate = require('celebrate');
const { Joi } = Celebrate;
const app = express();

@@ -69,3 +69,3 @@

Returns a `function` with the middleware signature (`(req, res, next)`).
The single exported function from `celebrate`. Returns a `function` with the middleware signature (`(req, res, next)`).

@@ -81,2 +81,6 @@ - `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 incoming `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.

### `Celebrate.Joi`
`celebrate` exports the version of joi it is using internally. For maximum compatibility, you should use this version when passing in any validation schemas.
## Order

@@ -83,0 +87,0 @@

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