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

express-validator

Package Overview
Dependencies
Maintainers
2
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.12.1 to 2.12.2

.jscsrc

0

CHANGELOG.md

@@ -0,0 +0,0 @@ ## Change Log

4

lib/express_validator.js

@@ -70,3 +70,3 @@ var validator = require('validator');

};
},
}
};

@@ -211,3 +211,3 @@

this.values.forEach(function(value, i) {
if (value) {
if (value != null) {
var args = [value];

@@ -214,0 +214,0 @@ args = args.concat(Array.prototype.slice.call(_arguments));

@@ -12,3 +12,3 @@ {

],
"version": "2.12.1",
"version": "2.12.2",
"homepage": "https://github.com/ctavan/express-validator",

@@ -22,3 +22,6 @@ "license": "MIT",

"scripts": {
"test": "mocha ./test",
"test": "mocha",
"jshint": "jshint ./test ./lib",
"jscs": "jscs ./test ./lib",
"travis-build": "npm test && npm run jshint && npm run jscs",
"changelog": "github-changes -o ctavan -r express-validator -a -m YYYY/MM/DD --no-merges"

@@ -38,2 +41,3 @@ },

"github-changes": "1.0.0",
"jscs": "1.13.1",
"jshint": "2.7.0",

@@ -40,0 +44,0 @@ "mocha": "2.2.4",

@@ -20,4 +20,4 @@ // Sample app

customSanitizers: {
toTestSanitize: function(value) {
return "!!!!";
toTestSanitize: function() {
return "!!!!";
}

@@ -24,0 +24,0 @@ }

@@ -31,3 +31,3 @@ var chai = require('chai');

.send(data)
.end(function(err, res){
.end(function(err, res) {
test(res.body);

@@ -34,0 +34,0 @@ done();

@@ -33,3 +33,3 @@ var chai = require('chai');

.send(data)
.end(function(err, res){
.end(function(err, res) {
test(res.body);

@@ -36,0 +36,0 @@ done();

@@ -30,3 +30,3 @@ var chai = require('chai');

.get(path)
.end(function(err, res){
.end(function(err, res) {
test(res.body);

@@ -33,0 +33,0 @@ done();

@@ -30,3 +30,3 @@ var chai = require('chai');

.get(path)
.end(function(err, res){
.end(function(err, res) {
test(res.body);

@@ -33,0 +33,0 @@ done();

@@ -18,11 +18,2 @@ var chai = require('chai');

function getRoute(path, test, done) {
request(app)
.get(path)
.end(function(err, res) {
test(res.body);
done();
});
}
function postRoute(path, data, test, done) {

@@ -48,3 +39,3 @@ request(app)

it('should return property and sanitized value when body param is present', function(done) {
postRoute('/', {testparam: ' abcdf '}, pass, done);
postRoute('/', { testparam: ' abcdf ' }, pass, done);
});

@@ -51,0 +42,0 @@

@@ -7,2 +7,5 @@ var chai = require('chai');

function validation(req, res) {
req.sanitize('zerotest').toString();
req.sanitize('emptystrtest').toBoolean();
req.sanitize('falsetest').toString();
req.sanitize('testparam').whitelist(['a', 'b', 'c']);

@@ -25,2 +28,14 @@ res.send({ params: req.params, query: req.query, body: req.body });

if (body.body.hasOwnProperty('zerotest')) {
expect(body).to.have.deep.property('body.zerotest', '0');
}
if (body.body.hasOwnProperty('emptystrtest')) {
expect(body).to.have.deep.property('body.emptystrtest', false);
}
if (body.body.hasOwnProperty('falsetest')) {
expect(body).to.have.deep.property('body.falsetest', 'false');
}
}

@@ -86,3 +101,7 @@

it('should return properly sanitized values even if the original value is falsey, but not null/undefined', function(done) {
postRoute('/', { testparam: ' abcdef ', zerotest: 0, emptystrtest: '', falsetest: false }, pass, done);
});
});
});

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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