@xmachines/play-router 2.0.0 → 2.1.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/README.md +93 -76
- package/dist/base-route-map.d.ts +63 -57
- package/dist/base-route-map.d.ts.map +1 -1
- package/dist/base-route-map.js +65 -59
- package/dist/base-route-map.js.map +1 -1
- package/dist/build-tree.d.ts +13 -12
- package/dist/build-tree.d.ts.map +1 -1
- package/dist/build-tree.js +30 -28
- package/dist/build-tree.js.map +1 -1
- package/dist/create-route-map-from-tree.d.ts +15 -15
- package/dist/create-route-map-from-tree.js +15 -15
- package/dist/create-route-map.d.ts +18 -16
- package/dist/create-route-map.d.ts.map +1 -1
- package/dist/create-route-map.js +10 -9
- package/dist/create-route-map.js.map +1 -1
- package/dist/errors.d.ts +40 -38
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +40 -38
- package/dist/errors.js.map +1 -1
- package/dist/extract-routes.d.ts +8 -7
- package/dist/extract-routes.d.ts.map +1 -1
- package/dist/extract-routes.js +31 -27
- package/dist/extract-routes.js.map +1 -1
- package/dist/find-route.d.ts +18 -15
- package/dist/find-route.d.ts.map +1 -1
- package/dist/find-route.js +42 -38
- package/dist/find-route.js.map +1 -1
- package/dist/index.d.ts +6 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +11 -10
- package/dist/index.js.map +1 -1
- package/dist/machine-to-graph.d.ts +3 -2
- package/dist/machine-to-graph.d.ts.map +1 -1
- package/dist/machine-to-graph.js +20 -19
- package/dist/machine-to-graph.js.map +1 -1
- package/dist/query.d.ts +39 -37
- package/dist/query.d.ts.map +1 -1
- package/dist/query.js +62 -57
- package/dist/query.js.map +1 -1
- package/dist/router-bridge-base.d.ts +208 -190
- package/dist/router-bridge-base.d.ts.map +1 -1
- package/dist/router-bridge-base.js +235 -211
- package/dist/router-bridge-base.js.map +1 -1
- package/dist/router-sync.d.ts +41 -35
- package/dist/router-sync.d.ts.map +1 -1
- package/dist/router-sync.js +53 -45
- package/dist/router-sync.js.map +1 -1
- package/dist/types.d.ts +165 -147
- package/dist/types.d.ts.map +1 -1
- package/dist/url-pattern-utils.d.ts +53 -47
- package/dist/url-pattern-utils.d.ts.map +1 -1
- package/dist/url-pattern-utils.js +61 -55
- package/dist/url-pattern-utils.js.map +1 -1
- package/dist/validate-routes.d.ts +32 -31
- package/dist/validate-routes.d.ts.map +1 -1
- package/dist/validate-routes.js +30 -29
- package/dist/validate-routes.js.map +1 -1
- package/package.json +6 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"router-bridge-base.js","sourceRoot":"","sources":["../src/router-bridge-base.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"router-bridge-base.js","sourceRoot":"","sources":["../src/router-bridge-base.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CG;AAEH,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAAE,oBAAoB,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAEpE,OAAO,EACN,mBAAmB,EACnB,YAAY,EACZ,kBAAkB,EAClB,aAAa,EACb,gBAAgB,GAChB,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EAAE,0BAA0B,EAAE,MAAM,aAAa,CAAC;AACzD,OAAO,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAqBhE;;;;;;;;;;GAUG;AACH,MAAM,aAAa,GAAG,IAAI,OAAO,EAA4B,CAAC;AAE9D;;;;;;GAMG;AACH,MAAM,OAAgB,gBAAgB;IA6BjB;IACA;IA7BpB,mEAAmE;IACzD,WAAW,GAAY,KAAK,CAAC;IAC7B,gBAAgB,GAAY,KAAK,CAAC;IAClC,cAAc,GAAkB,IAAI,CAAC;IAC/C;;;;;;;;;;OAUG;IACO,sBAAsB,GAAY,KAAK,CAAC;IACxC,YAAY,GAA8B,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B,CAAC,QAAQ,CAAC,CAAC;IACnC,CAAC;IA6BD;;;;;;;;;;;;;;;;;;OAkBG;IACO,oBAAoB;QAC7B,OAAO,SAAS,CAAC;IAClB,CAAC;IAED;;;;;;;;;;;;;OAaG;IACO,sBAAsB;QAC/B,OAAO,SAAS,CAAC;IAClB,CAAC;CACD;AAED,SAAS,WAAW,KAAI,CAAC;AAEzB,SAAS,kBAAkB,CAC1B,MAAsC,EACtC,OAAuC;IAEvC,IAAI,OAAO,GAAe,WAAW,CAAC;IACtC,MAAM,OAAO,GAAuB;QACnC,KAAK,CAAC,UAA0C;YAC/C,OAAO,GAAG,WAAW,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;QAC5C,CAAC;QACD,OAAO;YACN,OAAO,EAAE,CAAC;QACX,CAAC;KACD,CAAC;IAEF,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;IACtB,OAAO,OAAO,CAAC;AAChB,CAAC"}
|
package/dist/router-sync.d.ts
CHANGED
|
@@ -13,56 +13,61 @@ export interface RouterStateIdMap {
|
|
|
13
13
|
getPathByStateId(id: string): string | null | undefined;
|
|
14
14
|
}
|
|
15
15
|
/**
|
|
16
|
-
*
|
|
16
|
+
* Matches a clean pathname against a route map, and reads each param of the match.
|
|
17
17
|
*
|
|
18
|
-
*
|
|
19
|
-
* semantics
|
|
18
|
+
* The low-level sync path and the framework sync path share this function.
|
|
19
|
+
* Therefore the semantics of the match in the route map stay identical.
|
|
20
20
|
*/
|
|
21
21
|
export declare function matchRouteMap(pathname: string, routeMap: RouterStateIdMap, extractParams: (pathname: string, stateId: string) => Record<string, string>): RouteMatch;
|
|
22
22
|
/**
|
|
23
|
-
*
|
|
23
|
+
* Normalizes a pathname before a lookup in the route map.
|
|
24
24
|
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
25
|
+
* The function removes a query fragment and a hash fragment, it joins each duplicate
|
|
26
|
+
* slash into one, and it refuses a path of an improbable length, because such a path
|
|
27
|
+
* must never enter the route resolution.
|
|
27
28
|
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
29
|
+
* It returns `null` for a path of more than 2048 characters, which is malformed or
|
|
30
|
+
* hostile input. An adapter that passes around
|
|
31
|
+
* `RouterBridgeBase.syncActorFromRouter()`, for example `VueRouterBridge`, must call
|
|
32
|
+
* this function itself, and it must return at once on a `null` value. That adapter
|
|
33
|
+
* then gives the same guarantee of the defense in depth as the shared base class.
|
|
32
34
|
*
|
|
33
|
-
* @param pathname -
|
|
34
|
-
* @returns
|
|
35
|
+
* @param pathname - The raw path string of a navigation event of the router.
|
|
36
|
+
* @returns The normalized path string, or `null` when the path is malformed or too long.
|
|
35
37
|
*
|
|
36
38
|
* @example
|
|
37
39
|
* ```typescript
|
|
38
40
|
* import { sanitizePathname } from "@xmachines/play-router";
|
|
39
41
|
*
|
|
40
42
|
* const clean = sanitizePathname(to.path);
|
|
41
|
-
* if (clean === null) return; //
|
|
43
|
+
* if (clean === null) return; // refuse a malformed path
|
|
42
44
|
* ```
|
|
43
45
|
*/
|
|
44
46
|
export declare function sanitizePathname(pathname: string): string | null;
|
|
45
47
|
/**
|
|
46
|
-
*
|
|
48
|
+
* Reads the named path parameters of a URL, with the URLPattern API.
|
|
47
49
|
*
|
|
48
|
-
*
|
|
49
|
-
* For
|
|
50
|
+
* The function takes the string of the pattern directly. Use it when you know the
|
|
51
|
+
* pattern already. For a read through the lookup of a state ID, see
|
|
52
|
+
* `RouterBridgeBase.extractParams`.
|
|
50
53
|
*
|
|
51
|
-
*
|
|
52
|
-
*
|
|
54
|
+
* The object of the return holds no undefined value. Such a value comes from an
|
|
55
|
+
* optional segment without a match, for example `/settings` against
|
|
56
|
+
* `/settings/:section?`.
|
|
53
57
|
*
|
|
54
|
-
* The
|
|
55
|
-
*
|
|
56
|
-
*
|
|
57
|
-
*
|
|
58
|
+
* The function normalizes the pattern with the rules of the match in `RouteMap`: a
|
|
59
|
+
* name with a hyphen, such as `:cat-id`, becomes `:cat_id` for URLPattern. It then
|
|
60
|
+
* maps each group name back to the original param name. Therefore `/docs/123`
|
|
61
|
+
* against `/docs/:cat-id` gives `{ "cat-id": "123" }`.
|
|
58
62
|
*
|
|
59
|
-
*
|
|
60
|
-
* router
|
|
63
|
+
* The function decodes each percent sequence of a value (`john%20doe` → `john doe`),
|
|
64
|
+
* as a framework router does, for example vue-router. It keeps a malformed sequence
|
|
65
|
+
* raw.
|
|
61
66
|
*
|
|
62
|
-
* @param pathname - The concrete URL pathname
|
|
63
|
-
* @param pattern - The URL pattern
|
|
64
|
-
* @returns
|
|
65
|
-
* @throws {URLPatternUnavailableError} When `URLPattern` is absent and the pattern
|
|
67
|
+
* @param pathname - The concrete URL pathname, for example `/profile/alice`
|
|
68
|
+
* @param pattern - The template of the URL pattern, for example `/profile/:username`
|
|
69
|
+
* @returns The record of the parameter values of the read, or `{}` for a static pattern.
|
|
70
|
+
* @throws {URLPatternUnavailableError} When `URLPattern` is absent and the pattern holds a parameter.
|
|
66
71
|
*
|
|
67
72
|
* @example
|
|
68
73
|
* ```typescript
|
|
@@ -72,21 +77,22 @@ export declare function sanitizePathname(pathname: string): string | null;
|
|
|
72
77
|
* // → { username: "alice" }
|
|
73
78
|
*
|
|
74
79
|
* extractRouteParams("/settings", "/settings/:section?")
|
|
75
|
-
* // → {}
|
|
80
|
+
* // → {} — the optional param is absent, and the object holds it not
|
|
76
81
|
* ```
|
|
77
82
|
*/
|
|
78
83
|
export declare function extractRouteParams(pathname: string, pattern: string): Record<string, string>;
|
|
79
84
|
/**
|
|
80
|
-
*
|
|
81
|
-
*
|
|
85
|
+
* Parses a URL search string into the plain object that a `play.route` event
|
|
86
|
+
* needs.
|
|
82
87
|
*/
|
|
83
88
|
export declare function extractQuery(search: string): Record<string, string>;
|
|
84
89
|
/**
|
|
85
|
-
*
|
|
90
|
+
* Builds a normalized `play.route` event from the raw input of a router or of a
|
|
91
|
+
* browser.
|
|
86
92
|
*
|
|
87
|
-
*
|
|
88
|
-
*
|
|
89
|
-
*
|
|
93
|
+
* `connectRouter()` of `@xmachines/play-dom-router` and `RouterBridgeBase` both use
|
|
94
|
+
* this helper. Therefore a low-level adapter and a framework adapter clean each
|
|
95
|
+
* pathname, match each route, and read each query in the same way.
|
|
90
96
|
*/
|
|
91
97
|
export declare function buildPlayRouteEvent(options: BuildPlayRouteEventOptions): {
|
|
92
98
|
pathname: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"router-sync.d.ts","sourceRoot":"","sources":["../src/router-sync.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAWjD,MAAM,WAAW,UAAU;IAC1B,EAAE,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IAC9B,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAChC;AAED,MAAM,WAAW,0BAA0B;IAC1C,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC5B,KAAK,EAAE,CAAC,iBAAiB,EAAE,MAAM,KAAK,UAAU,CAAC;CACjD;AAED,MAAM,WAAW,gBAAgB;IAChC,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IAC1D,gBAAgB,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;CACxD;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAC5B,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,gBAAgB,EAC1B,aAAa,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,KAAK,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAC1E,UAAU,CAUZ;AAED
|
|
1
|
+
{"version":3,"file":"router-sync.d.ts","sourceRoot":"","sources":["../src/router-sync.ts"],"names":[],"m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mBAAmB,CAClC,OAAO,EAAE,0BAA0B,GACjC;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,cAAc,CAAA;CAAE,GAAG,IAAI,CAsBpD"}
|
package/dist/router-sync.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { getURLPatternCtor, getNormalizedParamNameMap, getCompiledPattern, isParameterizedPattern, } from "./url-pattern-utils.js";
|
|
2
2
|
import { URLPatternUnavailableError } from "./errors.js";
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
4
|
+
* Matches a clean pathname against a route map, and reads each param of the match.
|
|
5
5
|
*
|
|
6
|
-
*
|
|
7
|
-
* semantics
|
|
6
|
+
* The low-level sync path and the framework sync path share this function.
|
|
7
|
+
* Therefore the semantics of the match in the route map stay identical.
|
|
8
8
|
*/
|
|
9
9
|
export function matchRouteMap(pathname, routeMap, extractParams) {
|
|
10
10
|
const stateId = routeMap.getStateIdByPath(pathname);
|
|
@@ -17,25 +17,27 @@ export function matchRouteMap(pathname, routeMap, extractParams) {
|
|
|
17
17
|
};
|
|
18
18
|
}
|
|
19
19
|
/**
|
|
20
|
-
*
|
|
20
|
+
* Normalizes a pathname before a lookup in the route map.
|
|
21
21
|
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
22
|
+
* The function removes a query fragment and a hash fragment, it joins each duplicate
|
|
23
|
+
* slash into one, and it refuses a path of an improbable length, because such a path
|
|
24
|
+
* must never enter the route resolution.
|
|
24
25
|
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
26
|
+
* It returns `null` for a path of more than 2048 characters, which is malformed or
|
|
27
|
+
* hostile input. An adapter that passes around
|
|
28
|
+
* `RouterBridgeBase.syncActorFromRouter()`, for example `VueRouterBridge`, must call
|
|
29
|
+
* this function itself, and it must return at once on a `null` value. That adapter
|
|
30
|
+
* then gives the same guarantee of the defense in depth as the shared base class.
|
|
29
31
|
*
|
|
30
|
-
* @param pathname -
|
|
31
|
-
* @returns
|
|
32
|
+
* @param pathname - The raw path string of a navigation event of the router.
|
|
33
|
+
* @returns The normalized path string, or `null` when the path is malformed or too long.
|
|
32
34
|
*
|
|
33
35
|
* @example
|
|
34
36
|
* ```typescript
|
|
35
37
|
* import { sanitizePathname } from "@xmachines/play-router";
|
|
36
38
|
*
|
|
37
39
|
* const clean = sanitizePathname(to.path);
|
|
38
|
-
* if (clean === null) return; //
|
|
40
|
+
* if (clean === null) return; // refuse a malformed path
|
|
39
41
|
* ```
|
|
40
42
|
*/
|
|
41
43
|
export function sanitizePathname(pathname) {
|
|
@@ -46,26 +48,29 @@ export function sanitizePathname(pathname) {
|
|
|
46
48
|
return withoutHash.replace(/\/+/g, "/");
|
|
47
49
|
}
|
|
48
50
|
/**
|
|
49
|
-
*
|
|
51
|
+
* Reads the named path parameters of a URL, with the URLPattern API.
|
|
50
52
|
*
|
|
51
|
-
*
|
|
52
|
-
* For
|
|
53
|
+
* The function takes the string of the pattern directly. Use it when you know the
|
|
54
|
+
* pattern already. For a read through the lookup of a state ID, see
|
|
55
|
+
* `RouterBridgeBase.extractParams`.
|
|
53
56
|
*
|
|
54
|
-
*
|
|
55
|
-
*
|
|
57
|
+
* The object of the return holds no undefined value. Such a value comes from an
|
|
58
|
+
* optional segment without a match, for example `/settings` against
|
|
59
|
+
* `/settings/:section?`.
|
|
56
60
|
*
|
|
57
|
-
* The
|
|
58
|
-
*
|
|
59
|
-
*
|
|
60
|
-
*
|
|
61
|
+
* The function normalizes the pattern with the rules of the match in `RouteMap`: a
|
|
62
|
+
* name with a hyphen, such as `:cat-id`, becomes `:cat_id` for URLPattern. It then
|
|
63
|
+
* maps each group name back to the original param name. Therefore `/docs/123`
|
|
64
|
+
* against `/docs/:cat-id` gives `{ "cat-id": "123" }`.
|
|
61
65
|
*
|
|
62
|
-
*
|
|
63
|
-
* router
|
|
66
|
+
* The function decodes each percent sequence of a value (`john%20doe` → `john doe`),
|
|
67
|
+
* as a framework router does, for example vue-router. It keeps a malformed sequence
|
|
68
|
+
* raw.
|
|
64
69
|
*
|
|
65
|
-
* @param pathname - The concrete URL pathname
|
|
66
|
-
* @param pattern - The URL pattern
|
|
67
|
-
* @returns
|
|
68
|
-
* @throws {URLPatternUnavailableError} When `URLPattern` is absent and the pattern
|
|
70
|
+
* @param pathname - The concrete URL pathname, for example `/profile/alice`
|
|
71
|
+
* @param pattern - The template of the URL pattern, for example `/profile/:username`
|
|
72
|
+
* @returns The record of the parameter values of the read, or `{}` for a static pattern.
|
|
73
|
+
* @throws {URLPatternUnavailableError} When `URLPattern` is absent and the pattern holds a parameter.
|
|
69
74
|
*
|
|
70
75
|
* @example
|
|
71
76
|
* ```typescript
|
|
@@ -75,7 +80,7 @@ export function sanitizePathname(pathname) {
|
|
|
75
80
|
* // → { username: "alice" }
|
|
76
81
|
*
|
|
77
82
|
* extractRouteParams("/settings", "/settings/:section?")
|
|
78
|
-
* // → {}
|
|
83
|
+
* // → {} — the optional param is absent, and the object holds it not
|
|
79
84
|
* ```
|
|
80
85
|
*/
|
|
81
86
|
export function extractRouteParams(pathname, pattern) {
|
|
@@ -84,14 +89,14 @@ export function extractRouteParams(pathname, pattern) {
|
|
|
84
89
|
throw new URLPatternUnavailableError();
|
|
85
90
|
if (!isParameterizedPattern(pattern))
|
|
86
91
|
return {};
|
|
87
|
-
// Compile with the SAME normalization
|
|
88
|
-
// URLPattern
|
|
89
|
-
//
|
|
92
|
+
// Compile the pattern with the SAME normalization as the match in RouteMap.
|
|
93
|
+
// Without it, URLPattern reads ":cat-id" as the group ":cat" and the literal "-id",
|
|
94
|
+
// and the read of the params then contradicts the map that matched the path.
|
|
90
95
|
const urlPattern = getCompiledPattern(pattern, Ctor);
|
|
91
96
|
const match = urlPattern.exec({ pathname });
|
|
92
97
|
if (!match?.pathname.groups)
|
|
93
98
|
return {};
|
|
94
|
-
// Map normalized group
|
|
99
|
+
// Map each normalized group name (":cat_id") back to its original param name ("cat-id").
|
|
95
100
|
const nameMap = getNormalizedParamNameMap(pattern);
|
|
96
101
|
const params = {};
|
|
97
102
|
for (const [key, value] of Object.entries(match.pathname.groups)) {
|
|
@@ -102,8 +107,9 @@ export function extractRouteParams(pathname, pattern) {
|
|
|
102
107
|
return params;
|
|
103
108
|
}
|
|
104
109
|
/**
|
|
105
|
-
*
|
|
106
|
-
* sequence is malformed
|
|
110
|
+
* Decodes each percent sequence of a URLPattern group value. It keeps the raw value
|
|
111
|
+
* when the sequence is malformed, because `decodeURIComponent` then throws a
|
|
112
|
+
* `URIError`.
|
|
107
113
|
*/
|
|
108
114
|
function decodeParamValue(value) {
|
|
109
115
|
try {
|
|
@@ -114,8 +120,8 @@ function decodeParamValue(value) {
|
|
|
114
120
|
}
|
|
115
121
|
}
|
|
116
122
|
/**
|
|
117
|
-
*
|
|
118
|
-
*
|
|
123
|
+
* Parses a URL search string into the plain object that a `play.route` event
|
|
124
|
+
* needs.
|
|
119
125
|
*/
|
|
120
126
|
export function extractQuery(search) {
|
|
121
127
|
try {
|
|
@@ -130,11 +136,12 @@ export function extractQuery(search) {
|
|
|
130
136
|
}
|
|
131
137
|
}
|
|
132
138
|
/**
|
|
133
|
-
*
|
|
139
|
+
* Builds a normalized `play.route` event from the raw input of a router or of a
|
|
140
|
+
* browser.
|
|
134
141
|
*
|
|
135
|
-
*
|
|
136
|
-
*
|
|
137
|
-
*
|
|
142
|
+
* `connectRouter()` of `@xmachines/play-dom-router` and `RouterBridgeBase` both use
|
|
143
|
+
* this helper. Therefore a low-level adapter and a framework adapter clean each
|
|
144
|
+
* pathname, match each route, and read each query in the same way.
|
|
138
145
|
*/
|
|
139
146
|
export function buildPlayRouteEvent(options) {
|
|
140
147
|
const pathname = sanitizePathname(options.pathname);
|
|
@@ -143,10 +150,11 @@ export function buildPlayRouteEvent(options) {
|
|
|
143
150
|
const match = options.match(pathname);
|
|
144
151
|
if (!match.to)
|
|
145
152
|
return null;
|
|
146
|
-
//
|
|
147
|
-
//
|
|
148
|
-
//
|
|
149
|
-
//
|
|
153
|
+
// The one place of the canonical form of the emitted event: a `play.route` event
|
|
154
|
+
// always carries a target with a '#' prefix. A route map can register a bare
|
|
155
|
+
// stateId, and it can return one, because RouteMap keeps the registered form.
|
|
156
|
+
// Therefore this code formats the target of the event, and no other code does
|
|
157
|
+
// it.
|
|
150
158
|
const to = match.to.startsWith("#") ? match.to : `#${match.to}`;
|
|
151
159
|
return {
|
|
152
160
|
pathname,
|
package/dist/router-sync.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"router-sync.js","sourceRoot":"","sources":["../src/router-sync.ts"],"names":[],"mappings":"AACA,OAAO,EAGN,iBAAiB,EACjB,yBAAyB,EACzB,kBAAkB,EAClB,sBAAsB,GACtB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,0BAA0B,EAAE,MAAM,aAAa,CAAC;AAkBzD;;;;;GAKG;AACH,MAAM,UAAU,aAAa,CAC5B,QAAgB,EAChB,QAA0B,EAC1B,aAA4E;IAE5E,MAAM,OAAO,GAAG,QAAQ,CAAC,gBAAgB,CAAC,QAAQ,CAAC,CAAC;IACpD,IAAI,CAAC,OAAO,EAAE,CAAC;QACd,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC;IACjC,CAAC;IAED,OAAO;QACN,EAAE,EAAE,OAAO;QACX,MAAM,EAAE,aAAa,CAAC,QAAQ,EAAE,OAAO,CAAC;KACxC,CAAC;AACH,CAAC;AAED
|
|
1
|
+
{"version":3,"file":"router-sync.js","sourceRoot":"","sources":["../src/router-sync.ts"],"names":[],"mappings":"AACA,OAAO,EAGN,iBAAiB,EACjB,yBAAyB,EACzB,kBAAkB,EAClB,sBAAsB,GACtB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,0BAA0B,EAAE,MAAM,aAAa,CAAC;AAkBzD;;;;;GAKG;AACH,MAAM,UAAU,aAAa,CAC5B,QAAgB,EAChB,QAA0B,EAC1B,aAA4E;I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