koa-dispatch
Advanced tools
Comparing version 2.0.0 to 2.0.1
16
index.js
@@ -119,5 +119,19 @@ /** | ||
var params = params.filter(function (key) { return !!paramifiers[key.name] }) | ||
.map(function (key) { return paramifiers[key.name] }); | ||
.map(function (key) { return paramifiers[key.name]; }).map(applyArg); | ||
// flatten the functions so we can yield them nicely | ||
return Array.prototype.concat.apply([], params); | ||
} | ||
/** | ||
* @param {Array} fns | ||
* @param {Number} i | ||
* @api private | ||
*/ | ||
function applyArg (fns, i) { | ||
return fns.map(function (fn) { | ||
return function () { | ||
return fn.call(this, arguments[i]); | ||
}; | ||
}); | ||
} |
@@ -5,3 +5,3 @@ { | ||
"repository": "cartograph/koa-dispatch", | ||
"version": "2.0.0", | ||
"version": "2.0.1", | ||
"keywords": [ | ||
@@ -8,0 +8,0 @@ "koa", |
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
4513
109