@emeryld/rrroutes-client 2.3.10 → 2.3.11

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.
@@ -149,10 +149,8 @@ type QueryFromArgs<L extends AnyLeafLowProfile, T extends ArgsTuple<L>> = ArgsFr
149
149
  } ? Q : undefined;
150
150
  /** Typed query key array derived from the leaf plus the specific args passed in. */
151
151
  type SplitUrl<L extends string> = L extends `/${infer A}` ? SplitUrl<A> : L extends `${infer A}/${infer B}` ? [A, ...SplitUrl<B>] : [L];
152
- type MapParams<P extends any[], Params> = P extends [infer A, ...infer Rest] ? A extends `:${infer Key}` ? [
153
- Params extends Record<Key, infer V> ? (string extends V ? A : V) : A,
154
- ...MapParams<Rest, Params>
155
- ] : [A, ...MapParams<Rest, Params>] : [];
152
+ type ParamValue<Params, Key extends string, Default = undefined> = Params extends Record<Key, infer V> ? V : Default;
153
+ type MapParams<P extends any[], Params> = P extends [infer A, ...infer Rest] ? A extends `:${infer Key}` ? [[ParamValue<Params, Key>], ...MapParams<Rest, Params>] : [A, ...MapParams<Rest, Params>] : [];
156
154
  export type QueryKeysFor<L extends AnyLeafLowProfile, T extends ArgsTuple<L>> = Prettify<readonly [
157
155
  L['method'],
158
156
  ...MapParams<SplitUrl<L['path']>, ParamsFromArgs<L, T>>,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@emeryld/rrroutes-client",
3
- "version": "2.3.10",
3
+ "version": "2.3.11",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "main": "dist/index.cjs",
@@ -19,7 +19,7 @@
19
19
  "dist"
20
20
  ],
21
21
  "dependencies": {
22
- "@emeryld/rrroutes-contract": "^2.4.14",
22
+ "@emeryld/rrroutes-contract": "^2.4.15",
23
23
  "zod": "^4.1.13"
24
24
  },
25
25
  "peerDependencies": {