@koa/router
Advanced tools
Comparing version 8.0.2 to 8.0.3
@@ -264,11 +264,18 @@ /** | ||
if (m.router) { | ||
m.router.stack.forEach(function (nestedLayer) { | ||
if (path) nestedLayer.setPrefix(path); | ||
if (router.opts.prefix) nestedLayer.setPrefix(router.opts.prefix); | ||
router.stack.push(nestedLayer); | ||
const cloneRouter = Object.assign(Object.create(Router.prototype), m.router, { | ||
stack: m.router.stack.slice(0) | ||
}); | ||
cloneRouter.stack.forEach(function (nestedLayer, index) { | ||
const cloneLayer = Object.assign(Object.create(Layer.prototype), nestedLayer); | ||
if (path) cloneLayer.setPrefix(path); | ||
if (router.opts.prefix) cloneLayer.setPrefix(router.opts.prefix); | ||
router.stack.push(cloneLayer); | ||
this[index] = cloneLayer; | ||
}, cloneRouter.stack); | ||
if (router.params) { | ||
Object.keys(router.params).forEach(function (key) { | ||
m.router.param(key, router.params[key]); | ||
cloneRouter.param(key, router.params[key]); | ||
}); | ||
@@ -275,0 +282,0 @@ } |
@@ -13,3 +13,3 @@ { | ||
"author": "Alex Mingoia <talk@alexmingoia.com>", | ||
"version": "8.0.2", | ||
"version": "8.0.3", | ||
"keywords": [ | ||
@@ -16,0 +16,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
33972
863