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 6.0.0 to 6.0.1

9

lib/index.js

@@ -10,2 +10,4 @@ 'use strict';

const isCelebrate = Symbol('isCelebrate');
const Celebrate = (schema, options) => {

@@ -41,2 +43,3 @@ const result = Joi.validate(schema || {}, validations.schema);

if (err) {
err[isCelebrate] = true;
err._meta = { source };

@@ -73,3 +76,3 @@ return callback(err);

return (err, req, res, next) => {
if (err.isJoi) {
if (err[isCelebrate]) {
const error = {

@@ -87,6 +90,4 @@ statusCode: 400,

for (var i = 0; i < err.details.length; i++) {
// Disabling because the only way to get this is to fake the Joi response which I don't feel like doing
/* $lab:coverage:off$ */
/* istanbul ignore next */
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));

@@ -93,0 +94,0 @@ }

{
"name": "celebrate",
"version": "6.0.0",
"version": "6.0.1",
"description": "A joi validation middleware for Express.",

@@ -8,4 +8,4 @@ "main": "lib/index.js",

"scripts": {
"lint": "belly-button -f",
"test": "npm run lint && lab -v -a code -p -t 100"
"lint": "belly-button -i 'lib/*.js' -f",
"test": "npm run lint && jest --ci"
},

@@ -36,4 +36,4 @@ "repository": {

"belly-button": "4.x.x",
"code": "4.x.x",
"lab": "14.x.x"
"expect": "21.2.x",
"jest": "21.2.x"
},

@@ -40,0 +40,0 @@ "engines": {

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