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.1.0 to 2.1.1

4

lib/express_validator.js

@@ -45,3 +45,3 @@ /*

Object.keys(validator).forEach(function(methodName) {
if (methodName.match(/^to/) || methodName in sanitizers) {
if (methodName.match(/^to/) || sanitizers.indexOf(methodName) !== -1) {
methods[methodName] = function() {

@@ -106,3 +106,3 @@ var arguments = Array.prototype.slice.call(arguments);

Object.keys(validator).forEach(function(methodName) {
if (!methodName.match(/^to/) && !(methodName in sanitizers)) {
if (!methodName.match(/^to/) && sanitizers.indexOf(methodName) === -1) {
methods[methodName] = function() {

@@ -109,0 +109,0 @@ var arguments = Array.prototype.slice.call(arguments);

@@ -11,3 +11,3 @@ {

],
"version": "2.1.0",
"version": "2.1.1",
"homepage": "https://github.com/ctavan/express-validator",

@@ -14,0 +14,0 @@ "repository": {

@@ -195,28 +195,10 @@ # express-validator

You can extend the `Validator` and `Filter` objects to add custom validation
and sanitization method.
You can add your own validators using `expressValidator.validator.extend(name, fn)`
Custom validation which always fails. Useful for debugging or for
adding messages manually when doing complex validation:
```javascript
var expressValidator = require('express-validator');
expressValidator.Validator.prototype.fail = function() {
//You could validate against this.str, instead of just erroring out.
this.error(this.msg);
return this;
};
expressValidator.validator.extend('isFinite', function (str) {
return isFinite(str);
});
```
Custom sanitization which lower-cases the string:
```javascript
expressValidator.Filter.prototype.toLowerCase = function(){
this.modify(this.str.toLowerCase());
return this.str;
};
```
## Changelog

@@ -223,0 +205,0 @@

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