express-validator
Advanced tools
Comparing version 2.0.0 to 2.1.0
@@ -11,3 +11,3 @@ { | ||
], | ||
"version": "2.0.0", | ||
"version": "2.1.0", | ||
"homepage": "https://github.com/ctavan/express-validator", | ||
@@ -26,3 +26,3 @@ "repository": { | ||
"dependencies": { | ||
"validator": "3.1.0" | ||
"validator": "3.5.0" | ||
}, | ||
@@ -29,0 +29,0 @@ "devDependencies": { |
@@ -31,6 +31,13 @@ # express-validator | ||
// checkBody only checks req.body; none of the other req parameters | ||
// Similarly checkParams only checks in req.params (URL params) and | ||
// checkQuery only checks req.query (GET params). | ||
req.checkBody('postparam', 'Invalid postparam').notEmpty().isInt(); | ||
req.assert('getparam', 'Invalid getparam').isInt(); | ||
req.assert('urlparam', 'Invalid urlparam').isAlpha(); | ||
req.checkParams('urlparam', 'Invalid urlparam').isAlpha(); | ||
req.checkQuery('getparam', 'Invalid getparam').isInt(); | ||
// OR assert can be used to check on all 3 types of params. | ||
// req.assert('postparam', 'Invalid postparam').notEmpty().isInt(); | ||
// req.assert('urlparam', 'Invalid urlparam').isAlpha(); | ||
// req.assert('getparam', 'Invalid getparam').isInt(); | ||
req.sanitize('postparam').toBoolean(); | ||
@@ -37,0 +44,0 @@ |
28628
275
+ Addedvalidator@3.5.0(transitive)
- Removedvalidator@3.1.0(transitive)
Updatedvalidator@3.5.0