@real-router/validation-plugin 0.3.0 → 0.4.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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@real-router/validation-plugin",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"type": "commonjs",
|
|
5
5
|
"description": "Route validation plugin with type guards and parameter validation",
|
|
6
6
|
"main": "./dist/cjs/index.js",
|
|
@@ -44,15 +44,15 @@
|
|
|
44
44
|
},
|
|
45
45
|
"sideEffects": false,
|
|
46
46
|
"dependencies": {
|
|
47
|
-
"@real-router/core": "^0.
|
|
47
|
+
"@real-router/core": "^0.44.0",
|
|
48
48
|
"@real-router/logger": "^0.2.1"
|
|
49
49
|
},
|
|
50
50
|
"peerDependencies": {
|
|
51
|
-
"@real-router/core": "^0.
|
|
51
|
+
"@real-router/core": "^0.44.0"
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {
|
|
54
54
|
"route-tree": "^0.3.4",
|
|
55
|
-
"type-guards": "^0.4.
|
|
55
|
+
"type-guards": "^0.4.4"
|
|
56
56
|
},
|
|
57
57
|
"scripts": {
|
|
58
58
|
"build": "tsdown --config-loader unrun",
|
|
@@ -8,6 +8,7 @@ interface EventMethodMap {
|
|
|
8
8
|
$start: "onStart";
|
|
9
9
|
$stop: "onStop";
|
|
10
10
|
$$start: "onTransitionStart";
|
|
11
|
+
$$leaveApprove: "onTransitionLeaveApprove";
|
|
11
12
|
$$cancel: "onTransitionCancel";
|
|
12
13
|
$$success: "onTransitionSuccess";
|
|
13
14
|
$$error: "onTransitionError";
|
|
@@ -21,6 +22,7 @@ const validEventNames = new Set<EventName>([
|
|
|
21
22
|
"$start",
|
|
22
23
|
"$stop",
|
|
23
24
|
"$$start",
|
|
25
|
+
"$$leaveApprove",
|
|
24
26
|
"$$cancel",
|
|
25
27
|
"$$success",
|
|
26
28
|
"$$error",
|
|
@@ -29,7 +31,7 @@ const validEventNames = new Set<EventName>([
|
|
|
29
31
|
export function validateEventName(eventName: unknown): void {
|
|
30
32
|
if (!validEventNames.has(eventName as EventName)) {
|
|
31
33
|
throw new TypeError(
|
|
32
|
-
`[router.addEventListener] Invalid event name: ${String(eventName)}. Must be one of: $start, $stop, $$start, $$cancel, $$success, $$error`,
|
|
34
|
+
`[router.addEventListener] Invalid event name: ${String(eventName)}. Must be one of: $start, $stop, $$start, $$leaveApprove, $$cancel, $$success, $$error`,
|
|
33
35
|
);
|
|
34
36
|
}
|
|
35
37
|
}
|
|
@@ -10,7 +10,7 @@ const VALID_OPTION_VALUES = {
|
|
|
10
10
|
|
|
11
11
|
const VALID_QUERY_PARAMS = {
|
|
12
12
|
arrayFormat: ["none", "brackets", "index", "comma"] as const,
|
|
13
|
-
booleanFormat: ["none", "
|
|
13
|
+
booleanFormat: ["none", "auto", "empty-true"] as const,
|
|
14
14
|
nullFormat: ["default", "hidden"] as const,
|
|
15
15
|
numberFormat: ["none", "auto"] as const,
|
|
16
16
|
} as const;
|