find-my-way
Advanced tools
Comparing version 0.2.2 to 0.2.3
11
index.js
@@ -40,3 +40,3 @@ 'use strict' | ||
// parametric route | ||
if (path[i] === ':') { | ||
if (path.charCodeAt(i) === 58 /* : */) { | ||
j = i + 1 | ||
@@ -46,3 +46,3 @@ this._insert(method, path.slice(0, i), 0, null, null, null) | ||
// isolate the parameter name | ||
while (i < len && path[i] !== '/') i++ | ||
while (i < len && path.charCodeAt(i) !== 47 /* / */) i++ | ||
params.push(path.slice(j, i)) | ||
@@ -61,3 +61,3 @@ | ||
// wildcard route | ||
} else if (path[i] === '*') { | ||
} else if (path.charCodeAt(i) === 42 /* * */) { | ||
this._insert(method, path.slice(0, i), 0, null, null, null) | ||
@@ -139,4 +139,3 @@ params.push('*') | ||
var i = 0 | ||
var len = req.url.length | ||
while (i < len && req.url[i] !== '?' && req.url[i] !== '#') i++ | ||
while (i < req.url.length && req.url.charCodeAt(i) !== 63 /* ? */ && req.url.charCodeAt(i) !== 35 /* # */) i++ | ||
var handle = this.find(req.method, req.url.slice(0, i)) | ||
@@ -201,3 +200,3 @@ if (!handle) return this._defaultRoute(req, res) | ||
i = 0 | ||
while (i < pathLen && path[i] !== '/') i++ | ||
while (i < pathLen && path.charCodeAt(i) !== 47 /* / */) i++ | ||
try { | ||
@@ -204,0 +203,0 @@ params[pindex++] = decodeURIComponent(path.slice(0, i)) |
{ | ||
"name": "find-my-way", | ||
"version": "0.2.2", | ||
"version": "0.2.3", | ||
"description": "Crazy fast http radix based router", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
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
27830
730