@koordinates/xstate-tree 4.6.1 → 4.6.3

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.
@@ -9,7 +9,6 @@ const matchRoute_1 = require("../matchRoute");
9
9
  function handleLocationChange(routes, basePath, path, search, meta) {
10
10
  console.debug("[xstate-tree] Matching routes", basePath, path, search, meta);
11
11
  const match = (0, matchRoute_1.matchRoute)(routes, basePath, path, search);
12
- console.debug("[xstate-tree] Match result", match);
13
12
  if (match.type === "no-matches") {
14
13
  const fourOhFour = {
15
14
  type: "ROUTING_404",
@@ -24,6 +23,7 @@ function handleLocationChange(routes, basePath, path, search, meta) {
24
23
  return;
25
24
  }
26
25
  else {
26
+ console.log("[xstate-tree] matched route", match.event);
27
27
  const matchedEvent = match.event;
28
28
  matchedEvent.meta = { ...(meta !== null && meta !== void 0 ? meta : {}) };
29
29
  matchedEvent.meta.indexEvent = true;
@@ -33,7 +33,7 @@ function matchRoute(routes, basePath, path, search) {
33
33
  return { type: "no-matches" };
34
34
  }
35
35
  else if (matchingRoute instanceof Error) {
36
- return { type: "match-error" };
36
+ return { type: "match-error", error: matchingRoute };
37
37
  }
38
38
  return { type: "matched", route: matchingRoute, event: event };
39
39
  }
@@ -518,6 +518,7 @@ declare type Return<TRoutes extends Route<any, any, any, any>[]> = {
518
518
  type: "no-matches";
519
519
  } | {
520
520
  type: "match-error";
521
+ error: unknown;
521
522
  };
522
523
 
523
524
  /**
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@koordinates/xstate-tree",
3
3
  "main": "lib/index.js",
4
4
  "types": "lib/xstate-tree.d.ts",
5
- "version": "4.6.1",
5
+ "version": "4.6.3",
6
6
  "license": "MIT",
7
7
  "description": "Build UIs with Actors using xstate and React",
8
8
  "keywords": [