Socket
Socket
Sign inDemoInstall

koa-router

Package Overview
Dependencies
Maintainers
1
Versions
91
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 9.1.0 to 9.4.0

5

lib/layer.js

@@ -1,2 +0,1 @@

const debug = require('debug')('koa-router');
const { pathToRegexp, compile, parse } = require('path-to-regexp');

@@ -45,4 +44,2 @@ const { parse: parseUrl, format: formatUrl } = require('url');

this.regexp = pathToRegexp(path, this.paramNames, this.opts);
debug('defined route %s %s', this.methods, `${this.opts.prefix}${this.path}`);
};

@@ -137,3 +134,3 @@

replace = params;
} else {
} else if (!options) {
options = params;

@@ -140,0 +137,0 @@ }

@@ -13,2 +13,3 @@ /**

const Layer = require('./layer');
const { pathToRegexp } = require('path-to-regexp');

@@ -293,3 +294,6 @@ /**

} else {
router.register(path || '(.*)', [], m, { end: false, ignoreCaptures: !hasPath });
const keys = [];
pathToRegexp(router.opts.prefix || '', keys);
const routerPrefixHasParam = router.opts.prefix && keys.length;
router.register(path || '([^\/]*)', [], m, { end: false, ignoreCaptures: !hasPath && !routerPrefixHasParam });
}

@@ -363,3 +367,3 @@ }

ctx.captures = layer.captures(path, ctx.captures);
ctx.params = layer.params(path, ctx.captures, ctx.params);
ctx.params = ctx.request.params = layer.params(path, ctx.captures, ctx.params);
ctx.routerPath = layer.path;

@@ -590,2 +594,4 @@ ctx.routerName = layer.name;

debug('defined route %s %s', route.methods, route.path);
return route;

@@ -592,0 +598,0 @@ };

2

package.json
{
"name": "koa-router",
"description": "Router middleware for koa. Provides RESTful resource routing.",
"version": "9.1.0",
"version": "9.4.0",
"author": "Alex Mingoia <talk@alexmingoia.com>",

@@ -6,0 +6,0 @@ "bugs": {

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