koa-compose
Advanced tools
Comparing version 4.1.0 to 4.2.0
@@ -9,2 +9,6 @@ 'use strict' | ||
function flatten (arr) { | ||
return arr.reduce((acc, next) => acc.concat(Array.isArray(next) ? flatten(next) : next), []) | ||
} | ||
/** | ||
@@ -22,2 +26,3 @@ * Compose `middleware` returning | ||
if (!Array.isArray(middleware)) throw new TypeError('Middleware stack must be an array!') | ||
middleware = flatten(middleware) | ||
for (const fn of middleware) { | ||
@@ -24,0 +29,0 @@ if (typeof fn !== 'function') throw new TypeError('Middleware must be composed of functions!') |
@@ -5,3 +5,3 @@ { | ||
"repository": "koajs/compose", | ||
"version": "4.1.0", | ||
"version": "4.2.0", | ||
"keywords": [ | ||
@@ -8,0 +8,0 @@ "koa", |
@@ -21,3 +21,3 @@ | ||
### compose([a, b, c, ...]) | ||
### compose([a, [b, c,] ...]) | ||
@@ -24,0 +24,0 @@ Compose the given middleware and return middleware. |
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
Deprecated
MaintenanceThe maintainer of the package marked it as deprecated. This could indicate that a single version should not be used, or that the package is no longer maintained and any new vulnerabilities will not be fixed.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
4319
46
1