trek-router
Advanced tools
Comparing version
@@ -80,2 +80,3 @@ 'use strict'; | ||
METHODS.forEach(function (m) { | ||
// Start from '/' | ||
_this.trees[m.toUpperCase()] = new Node('/', null, null, []); | ||
@@ -193,3 +194,3 @@ }); | ||
var e = cn.findEdge(search.charCodeAt(0)); | ||
if (e) { | ||
if (e !== undefined) { | ||
// Go deeper | ||
@@ -247,5 +248,6 @@ cn = e; | ||
var l = lcp(search, cn.prefix); | ||
var leq = l === pl; | ||
var e = undefined; | ||
if (l === pl) { | ||
if (leq) { | ||
search = search.substring(l); | ||
@@ -256,3 +258,3 @@ } | ||
e = cn.findEdge(search.charCodeAt(0)); | ||
if (e) { | ||
if (e !== undefined) { | ||
cn = e; | ||
@@ -262,5 +264,9 @@ continue; | ||
if (!leq) { | ||
return result; | ||
} | ||
// Search PNODE | ||
e = cn.findEdge(58 /*':'*/); | ||
if (e) { | ||
if (e !== undefined) { | ||
cn = e; | ||
@@ -282,3 +288,3 @@ l = search.length; | ||
e = cn.findEdge(42 /*'*'*/); | ||
if (e) { | ||
if (e !== undefined) { | ||
cn = e; | ||
@@ -285,0 +291,0 @@ // Catch-all node |
{ | ||
"name": "trek-router", | ||
"version": "0.1.2", | ||
"version": "0.1.3", | ||
"description": "A fast HTTP router", | ||
@@ -5,0 +5,0 @@ "repository": "trekjs/router", |
12201
1.25%267
1.91%