@dharmax/state-router 3.1.2 → 3.2.0

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.
package/dist/router.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- type RouteHandler = (...args: string[]) => void;
1
+ type RouteHandler = (...args: any[]) => void;
2
2
  export type RoutingMode = 'history' | 'hash';
3
3
  declare class Router {
4
4
  private mode;
package/dist/router.js CHANGED
@@ -60,7 +60,7 @@ class Router {
60
60
  if (match) {
61
61
  match.shift(); // Remove the full match element
62
62
  const queryParams = Object.fromEntries(new URLSearchParams(window.location.search));
63
- route.handler.apply({ queryParams }, match);
63
+ route.handler({ queryParams }, match);
64
64
  return true;
65
65
  }
66
66
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dharmax/state-router",
3
- "version": "3.1.2",
3
+ "version": "3.2.0",
4
4
  "description": "A cute and tight router and application state controller",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
package/src/router.ts CHANGED
@@ -1,4 +1,4 @@
1
- type RouteHandler = (...args: string[]) => void;
1
+ type RouteHandler = (...args: any[]) => void;
2
2
 
3
3
  interface Route {
4
4
  pattern: RegExp | null;
@@ -77,7 +77,7 @@ class Router {
77
77
  if (match) {
78
78
  match.shift(); // Remove the full match element
79
79
  const queryParams = Object.fromEntries(new URLSearchParams(window.location.search));
80
- route.handler.apply({queryParams}, match);
80
+ route.handler( {queryParams}, match);
81
81
  return true
82
82
  }
83
83
  }