express-validator
Advanced tools
Comparing version 2.18.0 to 2.19.0
@@ -0,0 +0,0 @@ ## Change Log |
module.exports = require('./lib/express_validator.js'); |
@@ -88,3 +88,3 @@ var validator = require('validator'); | ||
ValidatorChain.prototype.notEmpty = function() { | ||
return this.isLength(1); | ||
return this.isLength({ min: 1 }); | ||
}; | ||
@@ -91,0 +91,0 @@ |
@@ -12,3 +12,3 @@ { | ||
], | ||
"version": "2.18.0", | ||
"version": "2.19.0", | ||
"homepage": "https://github.com/ctavan/express-validator", | ||
@@ -34,3 +34,3 @@ "license": "MIT", | ||
"lodash": "3.10.x", | ||
"validator": "4.2.x" | ||
"validator": "4.5.x" | ||
}, | ||
@@ -37,0 +37,0 @@ "devDependencies": { |
@@ -232,4 +232,5 @@ # express-validator | ||
notEmpty: true, | ||
isLength: { | ||
options: [2, 10] // pass options to the validator with the options property as an array | ||
match: { | ||
options: ['example', 'i'] // pass options to the validator with the options property as an array | ||
// options: ['/example/i'] // match also accepts the full expression in the first parameter | ||
}, | ||
@@ -241,3 +242,3 @@ errorMessage: 'Invalid Password' // Error message for the parameter | ||
isLength: { | ||
options: [2, 10], | ||
options: [{ min: 2, max: 10 }], | ||
errorMessage: 'Must be between 2 and 10 chars long' // Error message for the validator, takes precedent over parameter message | ||
@@ -244,0 +245,0 @@ }, |
@@ -0,0 +0,0 @@ var chai = require('chai'); |
@@ -0,0 +0,0 @@ var chai = require('chai'); |
@@ -0,0 +0,0 @@ var chai = require('chai'); |
@@ -0,0 +0,0 @@ var chai = require('chai'); |
@@ -0,0 +0,0 @@ var chai = require('chai'); |
@@ -0,0 +0,0 @@ var chai = require('chai'); |
@@ -0,0 +0,0 @@ var chai = require('chai'); |
@@ -0,0 +0,0 @@ var chai = require('chai'); |
@@ -0,0 +0,0 @@ var chai = require('chai'); |
@@ -0,0 +0,0 @@ var chai = require('chai'); |
@@ -0,0 +0,0 @@ // Sample app |
@@ -0,0 +0,0 @@ var util = require('util'), |
@@ -0,0 +0,0 @@ var chai = require('chai'); |
@@ -0,0 +0,0 @@ var chai = require('chai'); |
@@ -0,0 +0,0 @@ var chai = require('chai'); |
@@ -0,0 +0,0 @@ var chai = require('chai'); |
@@ -0,0 +0,0 @@ var chai = require('chai'); |
@@ -0,0 +0,0 @@ var chai = require('chai'); |
@@ -0,0 +0,0 @@ var chai = require('chai'); |
@@ -0,0 +0,0 @@ var chai = require('chai'); |
@@ -0,0 +0,0 @@ var chai = require('chai'); |
@@ -0,0 +0,0 @@ var chai = require('chai'); |
@@ -0,0 +0,0 @@ var chai = require('chai'); |
@@ -0,0 +0,0 @@ var chai = require('chai'); |
@@ -15,3 +15,3 @@ var chai = require('chai'); | ||
.isInt() // with default message | ||
.isLength(2, 2).withMessage(mustBeTwoDigitsMessage); | ||
.isLength({ min: 2, max: 2 }).withMessage(mustBeTwoDigitsMessage); | ||
var errors = req.validationErrors(); | ||
@@ -88,3 +88,3 @@ if (errors) { | ||
.isInt() // should produce 'Default Error Message' | ||
.isLength(2).withMessage('Custom Error Message'); | ||
.isLength({ min: 2 }).withMessage('Custom Error Message'); | ||
@@ -95,2 +95,2 @@ expect(req.validationErrors()).to.deep.equal([ | ||
}); | ||
}); | ||
}); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
1981
382
113046
+ Addedvalidator@4.5.2(transitive)
- Removedvalidator@4.2.1(transitive)
Updatedvalidator@4.5.x