trek-router
Advanced tools
Comparing version 0.2.3 to 0.2.4
@@ -5,2 +5,4 @@ 'use strict'; | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } | ||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } | ||
@@ -14,2 +16,6 @@ | ||
var _slowEquals = require('slow-equals'); | ||
var _slowEquals2 = _interopRequireDefault(_slowEquals); | ||
const METHODS = ['CONNECT', 'DELETE', 'GET', 'HEAD', 'OPTIONS', 'PATCH', 'POST', 'PUT', 'TRACE']; | ||
@@ -230,3 +236,3 @@ | ||
// Search order static > param > match-any | ||
if (search.length === 0 || equalsLower(search, cn.prefix)) { | ||
if (search.length === 0 || _slowEquals2['default'](search, cn.prefix)) { | ||
// Found | ||
@@ -316,12 +322,2 @@ result[0] = cn.handler; | ||
function equalsLower(a, b) { | ||
var l = a.length; | ||
if (l !== b.length) return false; | ||
var i = 0; | ||
for (; i < l && a.charCodeAt(i) !== b.charCodeAt(i); ++i) { | ||
return false; | ||
} | ||
return true; | ||
} | ||
Router.METHODS = METHODS; | ||
@@ -328,0 +324,0 @@ |
{ | ||
"name": "trek-router", | ||
"version": "0.2.3", | ||
"version": "0.2.4", | ||
"description": "A fast HTTP router", | ||
@@ -25,3 +25,3 @@ "repository": "trekjs/router", | ||
"devDependencies": { | ||
"babel": "^5.2.15", | ||
"babel": "^5.2.17", | ||
"benchmark": "^1.0.0", | ||
@@ -46,3 +46,5 @@ "isparta": "^3.x", | ||
}, | ||
"dependencies": {} | ||
"dependencies": { | ||
"slow-equals": "0.0.2" | ||
} | ||
} |
13443
1
272
+ Addedslow-equals@0.0.2
+ Addedslow-equals@0.0.2(transitive)