@thi.ng/router 4.1.46 → 4.1.47

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/html.js +2 -2
  2. package/package.json +2 -2
package/html.js CHANGED
@@ -6,7 +6,7 @@ class HTMLRouter extends Router {
6
6
  hashHandler;
7
7
  useFragment;
8
8
  constructor(config) {
9
- super({ prefix: config.useFragment ? "#/" : "/", ...config });
9
+ super({ prefix: config.useFragment !== false ? "#/" : "/", ...config });
10
10
  this.useFragment = config.useFragment !== false;
11
11
  }
12
12
  start() {
@@ -43,7 +43,7 @@ class HTMLRouter extends Router {
43
43
  const old = this.current;
44
44
  const route = super.route(src, ctx);
45
45
  if (route && !equiv(route, old)) {
46
- this.currentPath = this.format(route) + (this.useFragment ? "" : location.search);
46
+ this.currentPath = this.useFragment ? location.search + this.format(route) : this.format(route) + location.search;
47
47
  if (mode === "push") {
48
48
  history.pushState(this.currentPath, "", this.currentPath);
49
49
  } else if (mode === "replace") {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thi.ng/router",
3
- "version": "4.1.46",
3
+ "version": "4.1.47",
4
4
  "description": "Generic trie-based router with support for wildcards, route param validation/coercion, auth",
5
5
  "type": "module",
6
6
  "module": "./index.js",
@@ -100,5 +100,5 @@
100
100
  ],
101
101
  "year": 2014
102
102
  },
103
- "gitHead": "d977f819bcafdcb2b24c45f8d01a167fe29fc85a\n"
103
+ "gitHead": "fc8b300a00eb479497b27467900b13d3152089ad\n"
104
104
  }