find-my-way
Advanced tools
Comparing version 1.0.0 to 1.0.1
@@ -27,3 +27,3 @@ 'use strict' | ||
var child = this.children[i] | ||
if (child.label === label && child.kind === kind && child.map) { | ||
if (child.label === label && child.kind === kind && (child.map || child.children.length)) { | ||
return child | ||
@@ -48,3 +48,3 @@ } | ||
var child = this.children[i] | ||
if (child.kind === kind && child.map) { | ||
if (child.kind === kind && (child.map || child.children.length)) { | ||
return child | ||
@@ -51,0 +51,0 @@ } |
{ | ||
"name": "find-my-way", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "Crazy fast http radix based router", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -175,2 +175,28 @@ 'use strict' | ||
test('common prefix', t => { | ||
t.plan(4) | ||
const findMyWay = FindMyWay() | ||
findMyWay.on('GET', '/f', (req, res, params) => { | ||
t.ok('inside route') | ||
}) | ||
findMyWay.on('GET', '/ff', (req, res, params) => { | ||
t.ok('inside route') | ||
}) | ||
findMyWay.on('GET', '/ffa', (req, res, params) => { | ||
t.ok('inside route') | ||
}) | ||
findMyWay.on('GET', '/ffb', (req, res, params) => { | ||
t.ok('inside route') | ||
}) | ||
findMyWay.lookup({ method: 'GET', url: '/f' }, null) | ||
findMyWay.lookup({ method: 'GET', url: '/ff' }, null) | ||
findMyWay.lookup({ method: 'GET', url: '/ffa' }, null) | ||
findMyWay.lookup({ method: 'GET', url: '/ffb' }, null) | ||
}) | ||
test('wildcard', t => { | ||
@@ -177,0 +203,0 @@ t.plan(1) |
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
29767
803