@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
|
}
|
package/lib/xstate-tree.d.ts
CHANGED
package/package.json
CHANGED