@xmachines/play-solid-router 1.0.0-beta.8 → 1.0.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/LICENSE +21 -0
- package/README.md +140 -556
- package/dist/create-play-router-provider.d.ts +62 -0
- package/dist/create-play-router-provider.d.ts.map +1 -0
- package/dist/create-play-router-provider.jsx +45 -0
- package/dist/create-play-router-provider.jsx.map +1 -0
- package/dist/index.d.ts +7 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/play-router-provider.d.ts +69 -17
- package/dist/play-router-provider.d.ts.map +1 -1
- package/dist/play-router-provider.jsx +38 -8
- package/dist/play-router-provider.jsx.map +1 -1
- package/dist/solid-router-bridge.d.ts +55 -13
- package/dist/solid-router-bridge.d.ts.map +1 -1
- package/dist/solid-router-bridge.js +72 -16
- package/dist/solid-router-bridge.js.map +1 -1
- package/dist/types.d.ts +0 -15
- package/dist/types.d.ts.map +1 -1
- package/package.json +27 -13
- package/dist/create-route-map.d.ts +0 -25
- package/dist/create-route-map.d.ts.map +0 -1
- package/dist/create-route-map.js +0 -36
- package/dist/create-route-map.js.map +0 -1
- package/dist/route-map.d.ts +0 -78
- package/dist/route-map.d.ts.map +0 -1
- package/dist/route-map.js +0 -161
- package/dist/route-map.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xmachines/play-solid-router",
|
|
3
|
-
"version": "1.0.0
|
|
3
|
+
"version": "1.0.0",
|
|
4
4
|
"description": "SolidJS Router adapter for XMachines Universal Player Architecture",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "XMachines Contributors",
|
|
7
7
|
"repository": {
|
|
8
8
|
"type": "git",
|
|
9
|
-
"url": "git@gitlab.com
|
|
9
|
+
"url": "git+ssh://git@gitlab.com/xmachin-es/xmachines-js.git",
|
|
10
10
|
"directory": "packages/play-solid-router"
|
|
11
11
|
},
|
|
12
12
|
"files": [
|
|
@@ -19,6 +19,7 @@
|
|
|
19
19
|
"types": "./dist/index.d.ts",
|
|
20
20
|
"exports": {
|
|
21
21
|
".": {
|
|
22
|
+
"source": "./src/index.ts",
|
|
22
23
|
"types": "./dist/index.d.ts",
|
|
23
24
|
"default": "./dist/index.js"
|
|
24
25
|
}
|
|
@@ -28,29 +29,42 @@
|
|
|
28
29
|
},
|
|
29
30
|
"scripts": {
|
|
30
31
|
"build": "tsc --build",
|
|
32
|
+
"lint": "oxlint .",
|
|
33
|
+
"format": "oxfmt .",
|
|
31
34
|
"test": "vitest",
|
|
32
35
|
"test:watch": "vitest",
|
|
33
|
-
"
|
|
34
|
-
"clean": "rm -rf dist *.tsbuildinfo node_modules/.vite node_modules/.vite-temp",
|
|
36
|
+
"clean": "rm -rf dist *.tsbuildinfo coverage node_modules/.svelte2tsx-* node_modules/.vite*",
|
|
35
37
|
"prepublishOnly": "npm run build"
|
|
36
38
|
},
|
|
37
39
|
"dependencies": {
|
|
38
|
-
"@xmachines/play": "1.0.0
|
|
39
|
-
"@xmachines/play-actor": "1.0.0
|
|
40
|
-
"@xmachines/play-router": "1.0.0
|
|
41
|
-
"@xmachines/play-signals": "1.0.0
|
|
40
|
+
"@xmachines/play": "1.0.0",
|
|
41
|
+
"@xmachines/play-actor": "1.0.0",
|
|
42
|
+
"@xmachines/play-router": "1.0.0",
|
|
43
|
+
"@xmachines/play-signals": "1.0.0"
|
|
42
44
|
},
|
|
43
45
|
"devDependencies": {
|
|
44
46
|
"@solidjs/router": "^0.16.1",
|
|
45
47
|
"@solidjs/testing-library": "^0.8.10",
|
|
46
|
-
"@
|
|
47
|
-
"
|
|
48
|
+
"@testing-library/jest-dom": "^6.9.1",
|
|
49
|
+
"@types/node": "^26.1.1",
|
|
50
|
+
"@vitest/browser-playwright": "^4.1.10",
|
|
51
|
+
"@xmachines/play-router-shared": "1.0.0",
|
|
52
|
+
"@xmachines/play-xstate": "1.0.0",
|
|
53
|
+
"@xmachines/shared": "1.0.0",
|
|
54
|
+
"jsdom": "^29.1.0",
|
|
55
|
+
"oxfmt": "^0.58.0",
|
|
56
|
+
"oxlint": "^1.73.0",
|
|
57
|
+
"solid-js": "^1.9.12",
|
|
48
58
|
"vite-plugin-solid": "^2.11.11",
|
|
49
|
-
"vitest": "^4.1.
|
|
50
|
-
"xstate": "^5.
|
|
59
|
+
"vitest": "^4.1.10",
|
|
60
|
+
"xstate": "^5.31.0"
|
|
51
61
|
},
|
|
52
62
|
"peerDependencies": {
|
|
53
63
|
"@solidjs/router": "^0.16.1",
|
|
54
|
-
"solid-js": "^1.8.0"
|
|
64
|
+
"solid-js": "^1.8.0",
|
|
65
|
+
"xstate": "^5.31.0"
|
|
66
|
+
},
|
|
67
|
+
"engines": {
|
|
68
|
+
"node": ">=22.0.0"
|
|
55
69
|
}
|
|
56
70
|
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Create RouteMap helper for SolidJS Router adapter
|
|
3
|
-
*
|
|
4
|
-
* Simplifies demo code by hiding route extraction complexity.
|
|
5
|
-
* Internally calls extractMachineRoutes() and getRoutableRoutes(),
|
|
6
|
-
* then constructs RouteMap with proper state ID ↔ path mappings.
|
|
7
|
-
*/
|
|
8
|
-
import type { AnyStateMachine } from "xstate";
|
|
9
|
-
import { RouteMap } from "./route-map.js";
|
|
10
|
-
/**
|
|
11
|
-
* Create a RouteMap from an XState machine
|
|
12
|
-
*
|
|
13
|
-
* @param machine - XState machine with route: {} config on states
|
|
14
|
-
* @returns RouteMap for bidirectional state ID ↔ path resolution
|
|
15
|
-
*
|
|
16
|
-
* @example
|
|
17
|
-
* ```typescript
|
|
18
|
-
* import { createRouteMap } from '@xmachines/play-solid-router';
|
|
19
|
-
* import { authMachine } from './machine.js';
|
|
20
|
-
*
|
|
21
|
-
* const routeMap = createRouteMap(authMachine);
|
|
22
|
-
* ```
|
|
23
|
-
*/
|
|
24
|
-
export declare function createRouteMap(machine: AnyStateMachine): RouteMap;
|
|
25
|
-
//# sourceMappingURL=create-route-map.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"create-route-map.d.ts","sourceRoot":"","sources":["../src/create-route-map.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,QAAQ,CAAC;AAE9C,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE1C;;;;;;;;;;;;;GAaG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,eAAe,GAAG,QAAQ,CAcjE"}
|
package/dist/create-route-map.js
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Create RouteMap helper for SolidJS Router adapter
|
|
3
|
-
*
|
|
4
|
-
* Simplifies demo code by hiding route extraction complexity.
|
|
5
|
-
* Internally calls extractMachineRoutes() and getRoutableRoutes(),
|
|
6
|
-
* then constructs RouteMap with proper state ID ↔ path mappings.
|
|
7
|
-
*/
|
|
8
|
-
import { extractMachineRoutes, getRoutableRoutes } from "@xmachines/play-router";
|
|
9
|
-
import { RouteMap } from "./route-map.js";
|
|
10
|
-
/**
|
|
11
|
-
* Create a RouteMap from an XState machine
|
|
12
|
-
*
|
|
13
|
-
* @param machine - XState machine with route: {} config on states
|
|
14
|
-
* @returns RouteMap for bidirectional state ID ↔ path resolution
|
|
15
|
-
*
|
|
16
|
-
* @example
|
|
17
|
-
* ```typescript
|
|
18
|
-
* import { createRouteMap } from '@xmachines/play-solid-router';
|
|
19
|
-
* import { authMachine } from './machine.js';
|
|
20
|
-
*
|
|
21
|
-
* const routeMap = createRouteMap(authMachine);
|
|
22
|
-
* ```
|
|
23
|
-
*/
|
|
24
|
-
export function createRouteMap(machine) {
|
|
25
|
-
// Extract route tree from machine
|
|
26
|
-
const routeTree = extractMachineRoutes(machine);
|
|
27
|
-
// Get only routable nodes (states with route: {} config)
|
|
28
|
-
const routes = getRoutableRoutes(routeTree);
|
|
29
|
-
// Map to RouteMapping format expected by RouteMap constructor
|
|
30
|
-
const mappings = routes.map((node) => ({
|
|
31
|
-
stateId: node.stateId,
|
|
32
|
-
path: node.fullPath,
|
|
33
|
-
}));
|
|
34
|
-
return new RouteMap(mappings);
|
|
35
|
-
}
|
|
36
|
-
//# sourceMappingURL=create-route-map.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"create-route-map.js","sourceRoot":"","sources":["../src/create-route-map.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AACjF,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE1C;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,cAAc,CAAC,OAAwB;IACtD,kCAAkC;IAClC,MAAM,SAAS,GAAG,oBAAoB,CAAC,OAAO,CAAC,CAAC;IAEhD,yDAAyD;IACzD,MAAM,MAAM,GAAG,iBAAiB,CAAC,SAAS,CAAC,CAAC;IAE5C,8DAA8D;IAC9D,MAAM,QAAQ,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;QACtC,OAAO,EAAE,IAAI,CAAC,OAAO;QACrB,IAAI,EAAE,IAAI,CAAC,QAAQ;KACnB,CAAC,CAAC,CAAC;IAEJ,OAAO,IAAI,QAAQ,CAAC,QAAQ,CAAC,CAAC;AAC/B,CAAC"}
|
package/dist/route-map.d.ts
DELETED
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* RouteMap for bidirectional state ID ↔ path mapping
|
|
3
|
-
*
|
|
4
|
-
* Provides efficient lookup between XMachines state IDs and SolidJS Router paths.
|
|
5
|
-
* Supports pattern matching for dynamic routes with parameters.
|
|
6
|
-
*/
|
|
7
|
-
import type { RouteMapping } from "./types.js";
|
|
8
|
-
export declare class RouteMap {
|
|
9
|
-
private stateToPath;
|
|
10
|
-
private pathToState;
|
|
11
|
-
private patternBuckets;
|
|
12
|
-
private pathMatchCache;
|
|
13
|
-
/**
|
|
14
|
-
* Create a RouteMap with bidirectional mappings
|
|
15
|
-
*
|
|
16
|
-
* @param mappings - Array of state ID to path mappings
|
|
17
|
-
*
|
|
18
|
-
* @example
|
|
19
|
-
* ```typescript
|
|
20
|
-
* const routeMap = new RouteMap([
|
|
21
|
-
* { stateId: '#home', path: '/' },
|
|
22
|
-
* { stateId: '#profile', path: '/profile/:userId' },
|
|
23
|
-
* { stateId: '#settings', path: '/settings/:section?' }
|
|
24
|
-
* ]);
|
|
25
|
-
* ```
|
|
26
|
-
*/
|
|
27
|
-
constructor(mappings: RouteMapping[]);
|
|
28
|
-
/**
|
|
29
|
-
* Get path pattern for a state ID
|
|
30
|
-
*
|
|
31
|
-
* @param stateId - XMachines state ID (e.g., '#profile')
|
|
32
|
-
* @returns Path pattern or undefined if not found
|
|
33
|
-
*
|
|
34
|
-
* @example
|
|
35
|
-
* ```typescript
|
|
36
|
-
* routeMap.getPath('#profile'); // '/profile/:userId'
|
|
37
|
-
* ```
|
|
38
|
-
*/
|
|
39
|
-
getPath(stateId: string): string | undefined;
|
|
40
|
-
/**
|
|
41
|
-
* Get state ID for a path, with pattern matching support
|
|
42
|
-
*
|
|
43
|
-
* Performs exact match first, then fuzzy pattern matching for dynamic routes.
|
|
44
|
-
* Supports both required (:param) and optional (:param?) parameters.
|
|
45
|
-
*
|
|
46
|
-
* @param path - Actual URL path (e.g., '/profile/123')
|
|
47
|
-
* @returns State ID or undefined if no match found
|
|
48
|
-
*
|
|
49
|
-
* @example
|
|
50
|
-
* ```typescript
|
|
51
|
-
* routeMap.getStateIdByPath('/profile/123'); // '#profile'
|
|
52
|
-
* routeMap.getStateIdByPath('/settings'); // '#settings'
|
|
53
|
-
* routeMap.getStateIdByPath('/settings/account'); // '#settings'
|
|
54
|
-
* ```
|
|
55
|
-
*/
|
|
56
|
-
getStateIdByPath(path: string): string | undefined;
|
|
57
|
-
/**
|
|
58
|
-
* Check if a path matches a pattern
|
|
59
|
-
*
|
|
60
|
-
* Supports:
|
|
61
|
-
* - Required parameters: :param
|
|
62
|
-
* - Optional parameters: :param?
|
|
63
|
-
*
|
|
64
|
-
* @param path - Actual URL path
|
|
65
|
-
* @param pattern - Route pattern with :param syntax
|
|
66
|
-
* @returns true if path matches pattern
|
|
67
|
-
*
|
|
68
|
-
* @example
|
|
69
|
-
* ```typescript
|
|
70
|
-
* matchesPattern('/profile/123', '/profile/:userId'); // true
|
|
71
|
-
* matchesPattern('/settings', '/settings/:section?'); // true
|
|
72
|
-
* matchesPattern('/settings/account', '/settings/:section?'); // true
|
|
73
|
-
* ```
|
|
74
|
-
*/
|
|
75
|
-
private getIndexKey;
|
|
76
|
-
private getCandidates;
|
|
77
|
-
}
|
|
78
|
-
//# sourceMappingURL=route-map.d.ts.map
|
package/dist/route-map.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"route-map.d.ts","sourceRoot":"","sources":["../src/route-map.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE/C,qBAAa,QAAQ;IACpB,OAAO,CAAC,WAAW,CAA6B;IAChD,OAAO,CAAC,WAAW,CAA6B;IAChD,OAAO,CAAC,cAAc,CAGlB;IACJ,OAAO,CAAC,cAAc,CAAoC;IAE1D;;;;;;;;;;;;;OAaG;gBACS,QAAQ,EAAE,YAAY,EAAE;IAuBpC;;;;;;;;;;OAUG;IACH,OAAO,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS;IAI5C;;;;;;;;;;;;;;;OAeG;IACH,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS;IA4BlD;;;;;;;;;;;;;;;;;OAiBG;IACH,OAAO,CAAC,WAAW;IAcnB,OAAO,CAAC,aAAa;CAwCrB"}
|
package/dist/route-map.js
DELETED
|
@@ -1,161 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* RouteMap for bidirectional state ID ↔ path mapping
|
|
3
|
-
*
|
|
4
|
-
* Provides efficient lookup between XMachines state IDs and SolidJS Router paths.
|
|
5
|
-
* Supports pattern matching for dynamic routes with parameters.
|
|
6
|
-
*/
|
|
7
|
-
export class RouteMap {
|
|
8
|
-
stateToPath = new Map();
|
|
9
|
-
pathToState = new Map();
|
|
10
|
-
patternBuckets = new Map();
|
|
11
|
-
pathMatchCache = new Map();
|
|
12
|
-
/**
|
|
13
|
-
* Create a RouteMap with bidirectional mappings
|
|
14
|
-
*
|
|
15
|
-
* @param mappings - Array of state ID to path mappings
|
|
16
|
-
*
|
|
17
|
-
* @example
|
|
18
|
-
* ```typescript
|
|
19
|
-
* const routeMap = new RouteMap([
|
|
20
|
-
* { stateId: '#home', path: '/' },
|
|
21
|
-
* { stateId: '#profile', path: '/profile/:userId' },
|
|
22
|
-
* { stateId: '#settings', path: '/settings/:section?' }
|
|
23
|
-
* ]);
|
|
24
|
-
* ```
|
|
25
|
-
*/
|
|
26
|
-
constructor(mappings) {
|
|
27
|
-
let patternOrder = 0;
|
|
28
|
-
mappings.forEach(({ stateId, path }) => {
|
|
29
|
-
this.stateToPath.set(stateId, path);
|
|
30
|
-
if (path.includes(":")) {
|
|
31
|
-
const pattern = path
|
|
32
|
-
.replace(/\/:(\w+)\?/g, "(?:/([^/]+))?")
|
|
33
|
-
.replace(/\/:(\w+)/g, "/([^/]+)");
|
|
34
|
-
const bucketKey = this.getIndexKey(path);
|
|
35
|
-
const bucket = this.patternBuckets.get(bucketKey) ?? [];
|
|
36
|
-
bucket.push({
|
|
37
|
-
pattern: new RegExp(`^${pattern}$`),
|
|
38
|
-
stateId,
|
|
39
|
-
order: patternOrder++,
|
|
40
|
-
});
|
|
41
|
-
this.patternBuckets.set(bucketKey, bucket);
|
|
42
|
-
return;
|
|
43
|
-
}
|
|
44
|
-
this.pathToState.set(path, stateId);
|
|
45
|
-
});
|
|
46
|
-
}
|
|
47
|
-
/**
|
|
48
|
-
* Get path pattern for a state ID
|
|
49
|
-
*
|
|
50
|
-
* @param stateId - XMachines state ID (e.g., '#profile')
|
|
51
|
-
* @returns Path pattern or undefined if not found
|
|
52
|
-
*
|
|
53
|
-
* @example
|
|
54
|
-
* ```typescript
|
|
55
|
-
* routeMap.getPath('#profile'); // '/profile/:userId'
|
|
56
|
-
* ```
|
|
57
|
-
*/
|
|
58
|
-
getPath(stateId) {
|
|
59
|
-
return this.stateToPath.get(stateId);
|
|
60
|
-
}
|
|
61
|
-
/**
|
|
62
|
-
* Get state ID for a path, with pattern matching support
|
|
63
|
-
*
|
|
64
|
-
* Performs exact match first, then fuzzy pattern matching for dynamic routes.
|
|
65
|
-
* Supports both required (:param) and optional (:param?) parameters.
|
|
66
|
-
*
|
|
67
|
-
* @param path - Actual URL path (e.g., '/profile/123')
|
|
68
|
-
* @returns State ID or undefined if no match found
|
|
69
|
-
*
|
|
70
|
-
* @example
|
|
71
|
-
* ```typescript
|
|
72
|
-
* routeMap.getStateIdByPath('/profile/123'); // '#profile'
|
|
73
|
-
* routeMap.getStateIdByPath('/settings'); // '#settings'
|
|
74
|
-
* routeMap.getStateIdByPath('/settings/account'); // '#settings'
|
|
75
|
-
* ```
|
|
76
|
-
*/
|
|
77
|
-
getStateIdByPath(path) {
|
|
78
|
-
// Strip query string and hash fragment for matching
|
|
79
|
-
const cleanPath = path.split("?")[0].split("#")[0];
|
|
80
|
-
// Direct lookup first (exact match)
|
|
81
|
-
if (this.pathToState.has(cleanPath)) {
|
|
82
|
-
return this.pathToState.get(cleanPath);
|
|
83
|
-
}
|
|
84
|
-
const cachedMatch = this.pathMatchCache.get(cleanPath);
|
|
85
|
-
if (cachedMatch !== undefined) {
|
|
86
|
-
return cachedMatch ?? undefined;
|
|
87
|
-
}
|
|
88
|
-
// Fuzzy match for dynamic routes
|
|
89
|
-
const candidates = this.getCandidates(this.getIndexKey(cleanPath));
|
|
90
|
-
for (const { pattern, stateId } of candidates) {
|
|
91
|
-
if (pattern.test(cleanPath)) {
|
|
92
|
-
this.pathMatchCache.set(cleanPath, stateId);
|
|
93
|
-
return stateId;
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
this.pathMatchCache.set(cleanPath, null);
|
|
97
|
-
return undefined;
|
|
98
|
-
}
|
|
99
|
-
/**
|
|
100
|
-
* Check if a path matches a pattern
|
|
101
|
-
*
|
|
102
|
-
* Supports:
|
|
103
|
-
* - Required parameters: :param
|
|
104
|
-
* - Optional parameters: :param?
|
|
105
|
-
*
|
|
106
|
-
* @param path - Actual URL path
|
|
107
|
-
* @param pattern - Route pattern with :param syntax
|
|
108
|
-
* @returns true if path matches pattern
|
|
109
|
-
*
|
|
110
|
-
* @example
|
|
111
|
-
* ```typescript
|
|
112
|
-
* matchesPattern('/profile/123', '/profile/:userId'); // true
|
|
113
|
-
* matchesPattern('/settings', '/settings/:section?'); // true
|
|
114
|
-
* matchesPattern('/settings/account', '/settings/:section?'); // true
|
|
115
|
-
* ```
|
|
116
|
-
*/
|
|
117
|
-
getIndexKey(path) {
|
|
118
|
-
const trimmed = path.startsWith("/") ? path.slice(1) : path;
|
|
119
|
-
if (trimmed.length === 0) {
|
|
120
|
-
return "/";
|
|
121
|
-
}
|
|
122
|
-
const segment = trimmed.split("/")[0];
|
|
123
|
-
if (segment.startsWith(":")) {
|
|
124
|
-
return "*";
|
|
125
|
-
}
|
|
126
|
-
return segment;
|
|
127
|
-
}
|
|
128
|
-
getCandidates(indexKey) {
|
|
129
|
-
const bucket = this.patternBuckets.get(indexKey) ?? [];
|
|
130
|
-
const wildcardBucket = this.patternBuckets.get("*") ?? [];
|
|
131
|
-
if (bucket.length === 0) {
|
|
132
|
-
return wildcardBucket;
|
|
133
|
-
}
|
|
134
|
-
if (wildcardBucket.length === 0) {
|
|
135
|
-
return bucket;
|
|
136
|
-
}
|
|
137
|
-
const merged = [];
|
|
138
|
-
let bucketIndex = 0;
|
|
139
|
-
let wildcardIndex = 0;
|
|
140
|
-
while (bucketIndex < bucket.length && wildcardIndex < wildcardBucket.length) {
|
|
141
|
-
if (bucket[bucketIndex].order < wildcardBucket[wildcardIndex].order) {
|
|
142
|
-
merged.push(bucket[bucketIndex]);
|
|
143
|
-
bucketIndex += 1;
|
|
144
|
-
}
|
|
145
|
-
else {
|
|
146
|
-
merged.push(wildcardBucket[wildcardIndex]);
|
|
147
|
-
wildcardIndex += 1;
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
while (bucketIndex < bucket.length) {
|
|
151
|
-
merged.push(bucket[bucketIndex]);
|
|
152
|
-
bucketIndex += 1;
|
|
153
|
-
}
|
|
154
|
-
while (wildcardIndex < wildcardBucket.length) {
|
|
155
|
-
merged.push(wildcardBucket[wildcardIndex]);
|
|
156
|
-
wildcardIndex += 1;
|
|
157
|
-
}
|
|
158
|
-
return merged;
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
//# sourceMappingURL=route-map.js.map
|
package/dist/route-map.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"route-map.js","sourceRoot":"","sources":["../src/route-map.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,MAAM,OAAO,QAAQ;IACZ,WAAW,GAAG,IAAI,GAAG,EAAkB,CAAC;IACxC,WAAW,GAAG,IAAI,GAAG,EAAkB,CAAC;IACxC,cAAc,GAAG,IAAI,GAAG,EAG7B,CAAC;IACI,cAAc,GAAG,IAAI,GAAG,EAAyB,CAAC;IAE1D;;;;;;;;;;;;;OAaG;IACH,YAAY,QAAwB;QACnC,IAAI,YAAY,GAAG,CAAC,CAAC;QACrB,QAAQ,CAAC,OAAO,CAAC,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE,EAAE;YACtC,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;YACpC,IAAI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