paramour 0.11.1 → 0.11.2

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 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 an `Out`-only fallback: a required or defaulted key must decode to a
119
- * value. Non-distributive so the `Presence` union inside {@link AnyCodec}
120
- * reads as `Out`, keeping concrete optional codecs assignable to it.
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,
@@ -46,10 +46,12 @@ export interface RouteDescription {
46
46
  readonly router: RouterKind;
47
47
  readonly search: SearchDescription;
48
48
  /**
49
- * Present (and `true`) only for a route defined with `trailingSlash: true`,
50
- * so descriptions of R6-default routes are unchanged.
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?: true;
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"] ? { trailingSlash: true } : {}),
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. Required, not
232
- * optional: an optional member here turns the wrong-router diagnostics
233
- * (an AppRoute passed where AnyPagesRoute is expected) into
234
- * exactOptionalPropertyTypes noise. Readers test it for truthiness, so a
235
- * plain-JS hand-built route without it gets the R6 default.
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
@@ -173,7 +173,7 @@ function routeData(router, path, config) {
173
173
  "~router": router,
174
174
  "~search": search ?? {},
175
175
  "~segments": segments,
176
- "~trailingSlash": trailingSlash ?? false,
176
+ "~trailingSlash": trailingSlash,
177
177
  };
178
178
  }
179
179
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "paramour",
3
- "version": "0.11.1",
3
+ "version": "0.11.2",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {