Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@koa/router

Package Overview
Dependencies
Maintainers
8
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@koa/router - npm Package Compare versions

Comparing version 8.0.2 to 8.0.3

17

lib/router.js

@@ -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",

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