New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

express-validation

Package Overview
Dependencies
Maintainers
1
Versions
36
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

express-validation - npm Package Compare versions

Comparing version 0.2.4 to 0.3.0

4

lib/index.js
'use strict';
var Joi = require('joi')
, _ = require('underscore');
, _ = require('lodash');

@@ -81,4 +81,4 @@ module.exports = function (schema) {

return res.status(options.status).json(response);
return next(response);
};
};
{
"name": "express-validation",
"version": "0.2.4",
"version": "0.3.0",
"author": "Andrew Keig <andrew.keig@gmail.com>",
"description": "express-validation is a middleware that validates the body, params, query, headers of a request and returns a 400 Bad request response; with errors; if any of the configured validation rules fail.",
"description": "express-validation is a middleware that validates the body, params, query, headers of a request and returns a response with errors; if any of the configured validation rules fail.",
"homepage": "https://github.com/andrewkeig/express-validation",

@@ -12,4 +12,4 @@ "repository": {

"dependencies": {
"joi": "4.0.0",
"underscore": "*"
"joi": "^4.7.0",
"lodash": "^2.4.1"
},

@@ -16,0 +16,0 @@ "devDependencies": {

express-validation
==================
express-validation is a middleware that validates the body, params, query, headers of a request and returns a 400 Bad request response; with errors; if any of the configured validation rules fail.
express-validation is a middleware that validates the body, params, query, headers of a request and returns a response with errors; if any of the configured validation rules fail.

@@ -27,2 +27,4 @@ [![build status](https://travis-ci.org/AndrewKeig/express-validation.svg)](http://travis-ci.org/andrewkeig/express-validation)

####Note: prior to version 0.3.0, we returned a json error response straight out of the middleware, this changed in 0.3.0, so you will need to add an express error handler.
```

@@ -34,3 +36,3 @@ var express = require('express')

, app = express();
I
app.use(express.bodyParser());

@@ -43,2 +45,7 @@ app.set('port', 3000);

//error handler, required as of 0.3.0
app.use(function(err, req, res, next){
res.status(400).json(err);
});
http.createServer(app);

@@ -45,0 +52,0 @@ ```

@@ -42,3 +42,7 @@ 'use strict';

app.use(function(err, req, res, next){
res.status(400).json(err);
});
http.createServer(app);
module.exports = app;

@@ -37,3 +37,3 @@ 'use strict';

response.errors.length.should.equal(1);
response.errors[0].messages.length.should.equal(2);
response.errors[0].messages.length.should.equal(1);
done();

@@ -40,0 +40,0 @@ });

@@ -101,3 +101,3 @@ 'use strict';

response.errors.length.should.equal(1);
response.errors[0].messages.length.should.equal(2);
response.errors[0].messages.length.should.equal(1);
response.errors[0].field.should.equal('accesstoken')

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

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