fast-koa-router
Advanced tools
Comparing version 0.2.0 to 0.2.1
@@ -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
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
No contributors or author data
MaintenancePackage does not specify a list of contributors or an author in package.json.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
57151
405
1