express-validator
Advanced tools
Comparing version 2.8.0 to 2.9.0
@@ -176,3 +176,3 @@ /* | ||
req.check = checkParam(req, function(item) { | ||
return req.param(item); | ||
return param(req, item); | ||
}); | ||
@@ -225,4 +225,4 @@ | ||
req.filter = function(param) { | ||
return sanitize(this, param, this.param(param)); | ||
req.filter = function(item) { | ||
return sanitize(this, item, param(req, item)); | ||
}; | ||
@@ -235,2 +235,19 @@ | ||
// Taken from express 3.x for express 4.x compatibility | ||
function param(req, name, defaultValue){ | ||
// route params like /user/:id | ||
if (req.params && req.params.hasOwnProperty(name) && undefined !== req.params[name]) { | ||
return req.params[name]; | ||
} | ||
// query string params | ||
if (undefined !== req.query[name]) { | ||
return req.query[name]; | ||
} | ||
// request body params via connect.bodyParser | ||
if (req.body && undefined !== req.body[name]) { | ||
return req.body[name]; | ||
} | ||
return defaultValue; | ||
} | ||
return next(); | ||
@@ -237,0 +254,0 @@ }; |
@@ -11,3 +11,3 @@ { | ||
], | ||
"version": "2.8.0", | ||
"version": "2.9.0", | ||
"homepage": "https://github.com/ctavan/express-validator", | ||
@@ -26,3 +26,3 @@ "repository": { | ||
"dependencies": { | ||
"validator": "3.26.0" | ||
"validator": "3.34.0" | ||
}, | ||
@@ -29,0 +29,0 @@ "devDependencies": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No License Found
License(Experimental) License information could not be found.
Found 1 instance in 1 package
33298
19
0
692
+ Addedvalidator@3.34.0(transitive)
- Removedvalidator@3.26.0(transitive)
Updatedvalidator@3.34.0