We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
uri
1 parent 275b02c commit fedd136Copy full SHA for fedd136
src/index.js
@@ -27,9 +27,9 @@ export default function Navaid(base, on404) {
27
28
$.run = function (uri) {
29
var i=0, params={}, arr, obj;
30
- for (; i < routes.length;) {
31
- obj = routes[i++];
32
- if (arr = obj.pattern.exec(fmt(uri || location.pathname))) {
+ uri = fmt(uri || location.pathname);
+ for (; i < routes.length; i++) {
+ if (arr = (obj=routes[i]).pattern.exec(uri)) {
33
for (i=0; i < obj.keys.length;) params[obj.keys[i]]=arr[++i] || null;
34
handlers[obj.route](params); // todo loop?
35
return $;
0 commit comments