Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

express-validator

Package Overview
Dependencies
Maintainers
1
Versions
121
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

express-validator - npm Package Compare versions

Comparing version 2.0.0 to 2.1.0

4

package.json

@@ -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 @@

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