dat-middleware
Advanced tools
Comparing version 1.8.0 to 1.8.1
@@ -428,3 +428,3 @@ var error = require('./error'); | ||
.map(reqValueForKeypath) | ||
.map(step.validate) | ||
.map(bindRight(step.validate, req)) | ||
.filter(exists) | ||
@@ -440,4 +440,4 @@ .map(formatError); | ||
} | ||
function firstError (value, i) { | ||
err = step.validate(value); | ||
function firstError (value, i, vals) { | ||
err = step.validate(value, i, vals, req); | ||
if (err) { | ||
@@ -444,0 +444,0 @@ err = formatError(err, i); |
{ | ||
"name": "dat-middleware", | ||
"version": "1.8.0", | ||
"version": "1.8.1", | ||
"description": "common request, response, body, query, and param validation, transformation, and flow control middleware", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -9,3 +9,3 @@ var createAppWithMiddleware = require('./fixtures/createAppWithMiddleware'); | ||
describe('next', function() { | ||
describe('normal next', function() { | ||
describe('handle errors', function() { | ||
beforeEach(function () { | ||
@@ -16,3 +16,3 @@ this.app = createAppWithMiddleware( | ||
}); | ||
it('should work pass args to console.log', function (done) { | ||
it('should next the error', function (done) { | ||
request(this.app) | ||
@@ -28,3 +28,3 @@ .get('/') | ||
describe('keypaths', function() { | ||
describe('handle keypaths', function() { | ||
beforeEach(function () { | ||
@@ -36,3 +36,3 @@ this.app = createAppWithMiddleware( | ||
}); | ||
it('should work replace keypaths before console.log', function (done) { | ||
it('should replace keypaths before nexting', function (done) { | ||
request(this.app) | ||
@@ -39,0 +39,0 @@ .get('/') |
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
Native code
Supply chain riskContains native code (e.g., compiled binaries or shared libraries). Including native code can obscure malicious behavior.
Found 7 instances in 1 package
0
69867
32