paramour 0.11.1 → 0.11.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.
- package/dist/codec.d.ts +6 -4
- package/dist/describe.d.ts +5 -3
- package/dist/describe.js +3 -1
- package/dist/route.d.ts +8 -6
- package/dist/route.js +1 -1
- package/package.json +1 -1
package/dist/codec.d.ts
CHANGED
|
@@ -115,11 +115,13 @@ export type PresenceOf<C extends AnyCodec> = C["~presence"];
|
|
|
115
115
|
* `undefined` — which is the honest fallback when no in-domain value means
|
|
116
116
|
* "nothing selected". This does not blur D2: the INPUT `.catch()` handles is
|
|
117
117
|
* still a present-but-malformed value, never absence. Every other presence
|
|
118
|
-
* keeps
|
|
119
|
-
* value
|
|
120
|
-
*
|
|
118
|
+
* keeps a defined fallback: a required or defaulted key must decode to a
|
|
119
|
+
* value, so `undefined` is excluded even when `Out` itself admits it (the
|
|
120
|
+
* runtime guard in `catch` would throw on it). Non-distributive so the
|
|
121
|
+
* `Presence` union inside {@link AnyCodec} takes the defined branch, keeping
|
|
122
|
+
* concrete optional codecs assignable to it.
|
|
121
123
|
*/
|
|
122
|
-
type CatchFallback<Out, P extends Presence> = [P] extends ["optional"] ? Out | undefined : Out
|
|
124
|
+
type CatchFallback<Out, P extends Presence> = [P] extends ["optional"] ? Out | undefined : Exclude<Out, undefined>;
|
|
123
125
|
/**
|
|
124
126
|
* Rejects value-form `.default()` arguments whose static type includes any
|
|
125
127
|
* function member: runtime {@link isFactory} would treat them as factories,
|
package/dist/describe.d.ts
CHANGED
|
@@ -46,10 +46,12 @@ export interface RouteDescription {
|
|
|
46
46
|
readonly router: RouterKind;
|
|
47
47
|
readonly search: SearchDescription;
|
|
48
48
|
/**
|
|
49
|
-
*
|
|
50
|
-
*
|
|
49
|
+
* The route's `trailingSlash` option exactly as defined: present whenever
|
|
50
|
+
* the config set it, `false` included, and absent when it was left unset.
|
|
51
|
+
* An explicit opt-out stays distinguishable from the R6 default, so a
|
|
52
|
+
* future app-wide default can be reflected without widening this type.
|
|
51
53
|
*/
|
|
52
|
-
readonly trailingSlash?:
|
|
54
|
+
readonly trailingSlash?: boolean;
|
|
53
55
|
}
|
|
54
56
|
/**
|
|
55
57
|
* The `search:` slot's three shapes: absent config, a codec map, or the
|
package/dist/describe.js
CHANGED
|
@@ -59,7 +59,9 @@ export function describeRoute(route) {
|
|
|
59
59
|
path: route.path,
|
|
60
60
|
router: route["~router"],
|
|
61
61
|
search: describeSearch(route["~search"]),
|
|
62
|
-
...(route["~trailingSlash"]
|
|
62
|
+
...(route["~trailingSlash"] === undefined
|
|
63
|
+
? {}
|
|
64
|
+
: { trailingSlash: route["~trailingSlash"] }),
|
|
63
65
|
};
|
|
64
66
|
}
|
|
65
67
|
/**
|
package/dist/route.d.ts
CHANGED
|
@@ -228,13 +228,15 @@ export interface Route<Path extends string, PC extends ParamsConfig<Path>, SC ex
|
|
|
228
228
|
readonly "~segments": readonly PathSegment[];
|
|
229
229
|
/**
|
|
230
230
|
* The define-time `trailingSlash` option (R6's exception): `buildPath`, and
|
|
231
|
-
* so `href`, append "/" to every non-root path when true.
|
|
232
|
-
*
|
|
233
|
-
*
|
|
234
|
-
*
|
|
235
|
-
*
|
|
231
|
+
* so `href`, append "/" to every non-root path when true. `undefined`
|
|
232
|
+
* when the config left it unset, kept apart from an explicit `false` so
|
|
233
|
+
* reflection can tell an opt-out from the default. Required, not optional:
|
|
234
|
+
* an optional member here turns the wrong-router diagnostics (an AppRoute
|
|
235
|
+
* passed where AnyPagesRoute is expected) into exactOptionalPropertyTypes
|
|
236
|
+
* noise. Readers test it for truthiness, so a plain-JS hand-built route
|
|
237
|
+
* without it gets the R6 default.
|
|
236
238
|
*/
|
|
237
|
-
readonly "~trailingSlash": boolean;
|
|
239
|
+
readonly "~trailingSlash": boolean | undefined;
|
|
238
240
|
}
|
|
239
241
|
/**
|
|
240
242
|
* Conditional on the path shape: dynamic paths REQUIRE `params` with exactly
|
package/dist/route.js
CHANGED