Skip to content

Commit

Permalink
fix: ignore querystring within $.run method;
Browse files Browse the repository at this point in the history
- Closes #9
  • Loading branch information
lukeed committed Jun 3, 2019
1 parent 0f5b5bb commit 1062d25
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,19 @@ export default function Navaid(base, on404) {

$.run = function (uri) {
var i=0, params={}, arr, obj;
uri = fmt(uri || location.pathname);
for (; i < routes.length; i++) {
if (arr = (obj=routes[i]).pattern.exec(uri)) {
for (i=0; i < obj.keys.length;) {
params[obj.keys[i]] = arr[++i] || null;
if (uri = fmt(uri || location.pathname)) {
uri = uri.match(/[^\?#]*/)[0];
for (; i < routes.length; i++) {
if (arr = (obj=routes[i]).pattern.exec(uri)) {
for (i=0; i < obj.keys.length;) {
params[obj.keys[i]] = arr[++i] || null;
}
obj.fn(params); // todo loop?
return $;
}
obj.fn(params); // todo loop?
return $;
}
if (on404) on404(uri);
}
if (uri && on404) on404(uri);
return $;
}

Expand Down

0 comments on commit 1062d25

Please sign in to comment.