find-my-way
Advanced tools
Comparing version 3.0.0 to 3.0.1
@@ -21,3 +21,3 @@ 'use strict' | ||
const httpMethods = http.METHODS | ||
const FULL_PATH_REGEXP = /^https?:\/\/.*\// | ||
const FULL_PATH_REGEXP = /^https?:\/\/.*?\// | ||
@@ -24,0 +24,0 @@ if (!isRegexSafe(FULL_PATH_REGEXP)) { |
14
node.js
@@ -125,3 +125,3 @@ 'use strict' | ||
child = this.children[':'] || this.children['*'] | ||
child = this.children[':'] | ||
if (child !== undefined && (child.numberOfChildren > 0 || child.handlers[method] !== null)) { | ||
@@ -131,2 +131,7 @@ return child | ||
child = this.children['*'] | ||
if (child !== undefined && (child.numberOfChildren > 0 || child.handlers[method] !== null)) { | ||
return child | ||
} | ||
return null | ||
@@ -143,3 +148,3 @@ } | ||
child = this.children[':'] || this.children['*'] | ||
child = this.children[':'] | ||
if (child !== undefined && (child.numberOfChildren > 0 || child.getVersionHandler(version, method) !== null)) { | ||
@@ -149,2 +154,7 @@ return child | ||
child = this.children['*'] | ||
if (child !== undefined && (child.numberOfChildren > 0 || child.getVersionHandler(version, method) !== null)) { | ||
return child | ||
} | ||
return null | ||
@@ -151,0 +161,0 @@ } |
{ | ||
"name": "find-my-way", | ||
"version": "3.0.0", | ||
"version": "3.0.1", | ||
"description": "Crazy fast http radix based router", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -16,2 +16,6 @@ 'use strict' | ||
findMyWay.on('GET', '/a/:id', (req, res) => { | ||
res.end('{"message":"hello world"}') | ||
}) | ||
t.deepEqual(findMyWay.find('GET', 'http://localhost/a'), findMyWay.find('GET', '/a')) | ||
@@ -21,1 +25,6 @@ t.deepEqual(findMyWay.find('GET', 'http://localhost:8080/a'), findMyWay.find('GET', '/a')) | ||
t.deepEqual(findMyWay.find('GET', 'https://localhost/a'), findMyWay.find('GET', '/a')) | ||
t.deepEqual(findMyWay.find('GET', 'http://localhost/a/100'), findMyWay.find('GET', '/a/100')) | ||
t.deepEqual(findMyWay.find('GET', 'http://localhost:8080/a/100'), findMyWay.find('GET', '/a/100')) | ||
t.deepEqual(findMyWay.find('GET', 'http://123.123.123.123/a/100'), findMyWay.find('GET', '/a/100')) | ||
t.deepEqual(findMyWay.find('GET', 'https://localhost/a/100'), findMyWay.find('GET', '/a/100')) |
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
170120
46
4747