Skip to content

Commit fedd136

Browse files
committed
fix: revert uri inlining
1 parent 275b02c commit fedd136

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ export default function Navaid(base, on404) {
2727

2828
$.run = function (uri) {
2929
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))) {
30+
uri = fmt(uri || location.pathname);
31+
for (; i < routes.length; i++) {
32+
if (arr = (obj=routes[i]).pattern.exec(uri)) {
3333
for (i=0; i < obj.keys.length;) params[obj.keys[i]]=arr[++i] || null;
3434
handlers[obj.route](params); // todo loop?
3535
return $;

0 commit comments

Comments
 (0)