Skip to content

Commit

Permalink
fix: revert uri inlining
Browse files Browse the repository at this point in the history
  • Loading branch information
lukeed committed Apr 25, 2019
1 parent 275b02c commit fedd136
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ export default function Navaid(base, on404) {

$.run = function (uri) {
var i=0, params={}, arr, obj;
for (; i < routes.length;) {
obj = routes[i++];
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)) {
for (i=0; i < obj.keys.length;) params[obj.keys[i]]=arr[++i] || null;
handlers[obj.route](params); // todo loop?
return $;
Expand Down

0 comments on commit fedd136

Please sign in to comment.