find-my-way
Advanced tools
Comparing version 1.8.0 to 1.8.1
@@ -247,2 +247,3 @@ 'use strict' | ||
var len = 0 | ||
var previousPath = path | ||
@@ -287,3 +288,9 @@ // found the route | ||
if (node === null) { | ||
return getWildcardNode(wildcardNode, method, originalPath, pathLenWildcard) | ||
node = currentNode.parametricBrother | ||
if (node === null) { | ||
return getWildcardNode(wildcardNode, method, originalPath, pathLenWildcard) | ||
} | ||
path = previousPath | ||
pathLen = previousPath.length | ||
len = prefixLen | ||
} | ||
@@ -290,0 +297,0 @@ var kind = node.kind |
10
node.js
@@ -22,2 +22,3 @@ 'use strict' | ||
this.wildcardChild = null | ||
this.parametricBrother = null | ||
} | ||
@@ -29,2 +30,11 @@ | ||
} | ||
if (node.kind === 1 || node.kind === 3 || node.kind === 4) { | ||
for (var i = 0; i < this.numberOfChildren; i++) { | ||
if (this.children[i].kind === 0) { | ||
this.children[i].parametricBrother = node | ||
} | ||
} | ||
} | ||
this.children.push(node) | ||
@@ -31,0 +41,0 @@ this.children.sort((n1, n2) => n1.kind - n2.kind) |
{ | ||
"name": "find-my-way", | ||
"version": "1.8.0", | ||
"version": "1.8.1", | ||
"description": "Crazy fast http radix based router", | ||
@@ -8,4 +8,4 @@ "main": "index.js", | ||
"bench": "node bench.js", | ||
"test": "standard && tap test/*.test.js", | ||
"coveralls": "tap test/*.test.js --cov --coverage-report=text-lcov | coveralls" | ||
"test": "standard && tap -j4 test/*.test.js", | ||
"coveralls": "tap -j4 test/*.test.js --cov --coverage-report=text-lcov | coveralls" | ||
}, | ||
@@ -31,7 +31,7 @@ "repository": { | ||
"benchmark": "^2.1.4", | ||
"coveralls": "^2.13.1", | ||
"request": "^2.81.0", | ||
"coveralls": "^3.0.0", | ||
"request": "^2.83.0", | ||
"standard": "^10.0.3", | ||
"tap": "^10.7.2" | ||
"tap": "^11.0.0" | ||
} | ||
} |
@@ -573,3 +573,3 @@ 'use strict' | ||
defaultRoute: (req, res) => { | ||
t.is(req.url, '/example/shared/nested/oops') | ||
t.is(req.url, '/example/shared/nested/oopss') | ||
} | ||
@@ -586,3 +586,3 @@ }) | ||
findMyWay.lookup({ method: 'GET', url: '/example/shared/nested/oops' }, null) | ||
findMyWay.lookup({ method: 'GET', url: '/example/shared/nested/oopss' }, null) | ||
findMyWay.lookup({ method: 'GET', url: '/example/other/nested/oops' }, null) | ||
@@ -589,0 +589,0 @@ }) |
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
84066
20
2458