eden-tanstack-query 0.0.6 → 0.0.7

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.
Files changed (2) hide show
  1. package/dist/index.d.ts +6 -2
  2. package/package.json +1 -1
package/dist/index.d.ts CHANGED
@@ -33,10 +33,14 @@ interface EdenQueryConfig<TThrowOnError extends ThrowOnErrorOption = true> {
33
33
  * Narrows data type by excluding error-shaped objects when throwOnError is true.
34
34
  * When throwOnError is true, errors are thrown before reaching callbacks like
35
35
  * `select` or `onSuccess`, so the data type should exclude error shapes.
36
+ *
37
+ * Uses conditional type to check if each union member has an `error: string` property,
38
+ * which handles cases like `{ error: string; message?: undefined }` that simple
39
+ * `Exclude<T, { error: string }>` misses due to structural typing quirks.
36
40
  */
37
- type NarrowedData<TData, TThrowOnError> = TThrowOnError extends true ? Exclude<TData, {
41
+ type NarrowedData<TData, TThrowOnError> = TThrowOnError extends true ? TData extends {
38
42
  error: string;
39
- }> : TData;
43
+ } ? never : TData : TData;
40
44
  interface EdenOptions<TEden = unknown> {
41
45
  eden?: TEden;
42
46
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eden-tanstack-query",
3
- "version": "0.0.6",
3
+ "version": "0.0.7",
4
4
  "description": "TanStack Query integration for Eden Treaty",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",