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

fast-koa-router

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fast-koa-router - npm Package Compare versions

Comparing version 1.3.0 to 1.3.1

.nyc_output/d1d2240f-eb7c-4557-be0d-cb350be1a6e8.json

2

.nyc_output/processinfo/index.json

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

{"processes":{"373b3c77-f04a-41e7-90e5-ec602ca50297":{"parent":null,"children":[]}},"files":{"/home/runner/work/fast-koa-router/fast-koa-router/src/middleware.ts":["373b3c77-f04a-41e7-90e5-ec602ca50297"],"/home/runner/work/fast-koa-router/fast-koa-router/src/router.ts":["373b3c77-f04a-41e7-90e5-ec602ca50297"],"/home/runner/work/fast-koa-router/fast-koa-router/src/parse.ts":["373b3c77-f04a-41e7-90e5-ec602ca50297"]},"externalIds":{}}
{"processes":{"d1d2240f-eb7c-4557-be0d-cb350be1a6e8":{"parent":null,"children":[]}},"files":{"/home/runner/work/fast-koa-router/fast-koa-router/src/middleware.ts":["d1d2240f-eb7c-4557-be0d-cb350be1a6e8"],"/home/runner/work/fast-koa-router/fast-koa-router/src/router.ts":["d1d2240f-eb7c-4557-be0d-cb350be1a6e8"],"/home/runner/work/fast-koa-router/fast-koa-router/src/parse.ts":["d1d2240f-eb7c-4557-be0d-cb350be1a6e8"]},"externalIds":{}}

@@ -93,6 +93,4 @@ "use strict";

}
const params = {};
let _matchedRoute = '';
routes = routes[method] || {};
if (routes[path]) {
if (routes[path] && routes[path].middleware) {
return { middleware: routes[path].middleware, _matchedRoute: path };

@@ -99,0 +97,0 @@ }

{
"name": "fast-koa-router",
"version": "1.3.0",
"version": "1.3.1",
"description": "",

@@ -5,0 +5,0 @@ "main": "build/middleware.js",

@@ -201,2 +201,37 @@ import * as assert from 'assert';

it('star path should also match with path not ending with /', function () {
let routes = handlePathVariables(
addPrefixMiddleware(
parse({
get: {
'/path': ['middleware'],
'/path/1': ['one'],
'/path/1/3/foo': ['foo'],
'/foo/*': ['star'],
'/*': ['initialStar']
}
}),
{ '/path': 'prefix' }
)
);
assert.deepStrictEqual(getPathMethod(routes, '/foo/', 'get'), {
_matchedRoute: '/foo/*',
params: {},
middleware: ['star']
});
assert.deepStrictEqual(getPathMethod(routes, '/foo', 'get'), {
_matchedRoute: '/foo/*',
params: {},
middleware: ['star']
});
assert.deepStrictEqual(getPathMethod(routes, '/foobar', 'get'), {
_matchedRoute: '/*',
params: {},
middleware: ['initialStar']
});
});
it('star path should also work with many params in path', function () {

@@ -203,0 +238,0 @@ let routes = handlePathVariables(

Sorry, the diff of this file is not supported yet

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