Socket
Socket
Sign inDemoInstall

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 0.2.0 to 0.2.1

.nyc_output/1b26e666-94b8-4fc7-b5f0-adf39bb8bfca.json

2

.nyc_output/processinfo/index.json

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

{"processes":{"2a184536-aec6-4ecc-9a27-5669bc82062c":{"parent":null,"children":["cb9c68a8-c80d-4643-bd19-88b3b31ec7b2"]},"cb9c68a8-c80d-4643-bd19-88b3b31ec7b2":{"parent":"2a184536-aec6-4ecc-9a27-5669bc82062c","children":[]}},"files":{"/Users/nikoskostoulas/dev/router/src/middleware.ts":["cb9c68a8-c80d-4643-bd19-88b3b31ec7b2"],"/Users/nikoskostoulas/dev/router/src/router.ts":["cb9c68a8-c80d-4643-bd19-88b3b31ec7b2"],"/Users/nikoskostoulas/dev/router/src/parse.ts":["cb9c68a8-c80d-4643-bd19-88b3b31ec7b2"]},"externalIds":{}}
{"processes":{"1b26e666-94b8-4fc7-b5f0-adf39bb8bfca":{"parent":null,"children":["ce917d1f-fd30-4869-a63b-cc4659cbe088"]},"ce917d1f-fd30-4869-a63b-cc4659cbe088":{"parent":"1b26e666-94b8-4fc7-b5f0-adf39bb8bfca","children":[]}},"files":{"/Users/nikoskostoulas/dev/router/src/middleware.ts":["ce917d1f-fd30-4869-a63b-cc4659cbe088"],"/Users/nikoskostoulas/dev/router/src/router.ts":["ce917d1f-fd30-4869-a63b-cc4659cbe088"],"/Users/nikoskostoulas/dev/router/src/parse.ts":["ce917d1f-fd30-4869-a63b-cc4659cbe088"]},"externalIds":{}}
export declare function parse(routes: any, path?: string, method?: any, parsedObj?: {}): {};
export declare function handlePathVariables(parsedObj: any): any;
export declare function getPathMethod(routes: any, path: any, method: any): {
export declare function getPathMethod(routes: any, path: string, method: any): {
route: any;
_matchedRoute: any;
_matchedRoute: string;
params?: undefined;

@@ -7,0 +7,0 @@ } | {

@@ -54,2 +54,5 @@ "use strict";

function getPathMethod(routes, path, method) {
if (path.endsWith('/')) {
path = path.substr(0, path.length - 1);
}
const params = {};

@@ -56,0 +59,0 @@ let _matchedRoute = '';

{
"name": "fast-koa-router",
"version": "0.2.0",
"version": "0.2.1",
"description": "",

@@ -16,3 +16,4 @@ "main": "build/middleware.js",

},
"author": "",
"author": "Nikos Kostoulas <nikostoulas@gmail.com>",
"repository": "nikostoulas/fast-koa-router",
"license": "ISC",

@@ -19,0 +20,0 @@ "nyc": {

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

it('should return routes ignoring ending slash', function() {
assert.deepEqual(getPathMethod(handlePathVariables(parse(routes)), '/nested/path/id/', 'policy'), {
route: [],
params: { id: 'id' },
_matchedRoute: '/nested/path/:id'
});
});
it('should return no route if path does not match', function() {

@@ -39,0 +47,0 @@ assert.deepEqual(getPathMethod(handlePathVariables(parse(routes)), '/nested/path/id/foo', 'policy'), {});

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