express-validation
Advanced tools
Comparing version 3.0.8 to 3.1.0
@@ -19,3 +19,3 @@ const Joi = require('joi'); | ||
const validate = (parameter) => schema[parameter].validateAsync(request[parameter], joiOptions) | ||
.then(result => handleMutation(request[parameter], result.value, evOptions.context)) | ||
.then(result => handleMutation(request, parameter, result.value, evOptions.context)) | ||
.catch(error => ({ [parameter]: error.details })); | ||
@@ -22,0 +22,0 @@ |
@@ -1,6 +0,4 @@ | ||
exports.handleMutation = (request, value, mutate) => { | ||
exports.handleMutation = (request, parameter, value, mutate) => { | ||
if (mutate) { | ||
Object.keys(value).forEach(parameter => { | ||
Object.defineProperty(request, parameter, { value: value[parameter], enumerable: true }); | ||
}); | ||
request[parameter] = value; | ||
} | ||
@@ -7,0 +5,0 @@ |
{ | ||
"name": "express-validation", | ||
"version": "3.0.8", | ||
"version": "3.1.0", | ||
"author": "Andrew Keig <andrew.keig@gmail.com>", | ||
@@ -36,5 +36,5 @@ "description": "express-validation is a middleware that validates a request and returns a response with errors; if any of the configured validation rules fail.", | ||
"dependencies": { | ||
"joi": "17.x.x", | ||
"@types/express": "4.x.x", | ||
"@types/hapi__joi": "16.x.x" | ||
"@types/express": "^4.17.13", | ||
"@types/hapi__joi": "16.x.x", | ||
"joi": "^17.6.0" | ||
}, | ||
@@ -41,0 +41,0 @@ "jest": { |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
17449
136
2
Updated@types/express@^4.17.13
Updatedjoi@^17.6.0