We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
ToObjectOutput
1 parent d426747 commit 5c7d46eCopy full SHA for 5c7d46e
src/index.ts
@@ -266,12 +266,12 @@ export function isValidForm<T extends Form>(
266
type ToObjectOutput<T extends Form> = {
267
[K in keyof T as T[K] extends PrivateField<any> | ((...args: any[]) => any)
268
? never
269
- : Exclude<K, "$key">]: T[K] extends Form
+ : K]: T[K] extends Form
270
? ToObjectOutput<T[K]>
271
: T[K] extends Field<any, infer U>
272
? U
273
- : T[K] extends FormsField<(arg: any) => Form>
274
- ? ToObjectOutput<T[K]["$forms"][number]>[]
+ : T[K] extends FormsField<infer U>
+ ? ToObjectOutput<ReturnType<U>>[]
275
: never;
276
};
277
0 commit comments