route-recognizer
Advanced tools
Comparing version 0.3.1 to 0.3.2
@@ -54,3 +54,3 @@ var createObject = Object.create; | ||
} | ||
; | ||
return match; | ||
@@ -83,3 +83,3 @@ } | ||
} | ||
function map (callback, addRouteCallback) { | ||
var map = function (callback, addRouteCallback) { | ||
var matcher = new Matcher(); | ||
@@ -95,3 +95,3 @@ callback(generateMatch("", matcher, this.delegate)); | ||
}, this); | ||
} | ||
}; | ||
@@ -134,5 +134,16 @@ // Normalizes percent-encoded values in `path` to upper-case and decodes percent-encoded | ||
var isArray = Array.isArray; | ||
var hasOwnProperty = Object.prototype.hasOwnProperty; | ||
function getParam(params, key) { | ||
if (typeof params !== "object" || params === null) { | ||
throw new Error("You must pass an object as the second argument to `generate`."); | ||
} | ||
if (!hasOwnProperty.call(params, key)) { | ||
throw new Error("You must provide param `" + key + "` to `generate`."); | ||
} | ||
var value = params[key]; | ||
return typeof value === "string" ? value : "" + value; | ||
var str = typeof value === "string" ? value : "" + value; | ||
if (str.length === 0) { | ||
throw new Error("You must provide a param `" + key + "`."); | ||
} | ||
return str; | ||
} | ||
@@ -388,3 +399,3 @@ var eachChar = []; | ||
}; | ||
; | ||
RecognizeResults.prototype.splice = Array.prototype.splice; | ||
@@ -640,3 +651,3 @@ RecognizeResults.prototype.slice = Array.prototype.slice; | ||
}; | ||
RouteRecognizer.VERSION = "0.3.0"; | ||
RouteRecognizer.VERSION = "0.3.2"; | ||
// Set to false to opt-out of encoding and decoding path segments. | ||
@@ -651,2 +662,3 @@ // See https://github.com/tildeio/route-recognizer/pull/55 | ||
export default RouteRecognizer; | ||
//# sourceMappingURL=route-recognizer.es.js.map |
(function (global, factory) { | ||
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : | ||
typeof define === 'function' && define.amd ? define('route-recognizer', factory) : | ||
(global.RouteRecognizer = factory()); | ||
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : | ||
typeof define === 'function' && define.amd ? define('route-recognizer', factory) : | ||
(global.RouteRecognizer = factory()); | ||
}(this, (function () { 'use strict'; | ||
@@ -60,3 +60,3 @@ | ||
} | ||
; | ||
return match; | ||
@@ -89,3 +89,3 @@ } | ||
} | ||
function map (callback, addRouteCallback) { | ||
var map = function (callback, addRouteCallback) { | ||
var matcher = new Matcher(); | ||
@@ -101,3 +101,3 @@ callback(generateMatch("", matcher, this.delegate)); | ||
}, this); | ||
} | ||
}; | ||
@@ -140,5 +140,16 @@ // Normalizes percent-encoded values in `path` to upper-case and decodes percent-encoded | ||
var isArray = Array.isArray; | ||
var hasOwnProperty = Object.prototype.hasOwnProperty; | ||
function getParam(params, key) { | ||
if (typeof params !== "object" || params === null) { | ||
throw new Error("You must pass an object as the second argument to `generate`."); | ||
} | ||
if (!hasOwnProperty.call(params, key)) { | ||
throw new Error("You must provide param `" + key + "` to `generate`."); | ||
} | ||
var value = params[key]; | ||
return typeof value === "string" ? value : "" + value; | ||
var str = typeof value === "string" ? value : "" + value; | ||
if (str.length === 0) { | ||
throw new Error("You must provide a param `" + key + "`."); | ||
} | ||
return str; | ||
} | ||
@@ -394,3 +405,3 @@ var eachChar = []; | ||
}; | ||
; | ||
RecognizeResults.prototype.splice = Array.prototype.splice; | ||
@@ -646,3 +657,3 @@ RecognizeResults.prototype.slice = Array.prototype.slice; | ||
}; | ||
RouteRecognizer.VERSION = "0.3.0"; | ||
RouteRecognizer.VERSION = "0.3.2"; | ||
// Set to false to opt-out of encoding and decoding path segments. | ||
@@ -659,2 +670,3 @@ // See https://github.com/tildeio/route-recognizer/pull/55 | ||
}))); | ||
//# sourceMappingURL=route-recognizer.js.map |
{ | ||
"name": "route-recognizer", | ||
"version": "0.3.1", | ||
"version": "0.3.2", | ||
"description": "A lightweight JavaScript library that matches paths against registered routes.", | ||
@@ -42,2 +42,3 @@ "author": "Yehuda Katz", | ||
"build": "ember build", | ||
"prepublish": "ember build --environment=production", | ||
"tsc": "tsc", | ||
@@ -44,0 +45,0 @@ "bench": "ember build && node ./bench/index.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
145061
1390