New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.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 7.0.1 to 7.0.2

16

lib/index.d.ts
import { ErrorRequestHandler, RequestHandler } from 'express';
import { Root as joi } from 'joi';

@@ -6,5 +7,6 @@ declare namespace Celebrate {

* Creates a Celebrate middleware function.
* @param {object} schema object where each key is one of ["params", "headers", "query", "body"] and the value is
* @param {Object} schema - object where each key is one of ["params", "headers", "query", "body"] and the value is
* a Joi schema.
* @param {object} config optional configuration options that will be passed directly into Joi.
* @param {Object} [config] - optional configuration options that will be passed directly into Joi.
* @returns {Function} an express middleware function
*/

@@ -19,2 +21,3 @@ function celebrate(schema: {

* Creates a Celebrate error handler middleware function.
* @returns {Function} an express error handler function
*/

@@ -25,5 +28,12 @@ function errors(): ErrorRequestHandler;

*/
export const Joi: object;
export const Joi: joi
/**
* Examines an error object to determine if it originated from the celebrate middleware.
* @param {Object} err - error object to check
* @returns {boolean}
*/
function isCelebrate(err:object): boolean;
}
export = Celebrate;

4

lib/index.js

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

const rules = new Map();
options = Object.assign({}, DEFAULTS, options);
const joiOpts = Object.assign({}, DEFAULTS, options);

@@ -84,3 +84,3 @@ const keys = Object.keys(schema);

req,
options,
options: joiOpts,
rules

@@ -87,0 +87,0 @@ }, next);

{
"name": "celebrate",
"version": "7.0.1",
"version": "7.0.2",
"description": "A joi validation middleware for Express.",

@@ -34,2 +34,3 @@ "main": "lib/index.js",

"@types/express": "4.x.x",
"@types/joi": "13.0.0",
"artificial": "0.1.x",

@@ -36,0 +37,0 @@ "belly-button": "4.x.x",

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