From 3409b6889de92ea399ab8b4ef14b542d46b009d4 Mon Sep 17 00:00:00 2001 From: Julian Schleemann Date: Tue, 20 Feb 2024 20:25:38 +0100 Subject: [PATCH] feat: don't exclude fields starting with __ --- src/formbuilder.tsx | 2 +- src/types.test.tsx | 5 ----- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/src/formbuilder.tsx b/src/formbuilder.tsx index d695b41..3adaef4 100644 --- a/src/formbuilder.tsx +++ b/src/formbuilder.tsx @@ -86,7 +86,7 @@ export type FormBuilder = FormBuilderRegisterFn & { ): $UseFieldArrayReturn; } : { - [K in Exclude]-?: FormBuilder< + [K in keyof T]-?: FormBuilder< T[K] extends Primitive ? T[K] : NonNullable >; }); diff --git a/src/types.test.tsx b/src/types.test.tsx index f13f252..3386557 100644 --- a/src/types.test.tsx +++ b/src/types.test.tsx @@ -132,10 +132,5 @@ describe("Types", () => { expectTypeOf>().toMatchTypeOf< FormBuilder >(); - - // Ignored prefixes - expectTypeOf>().toMatchTypeOf< - FormBuilder<{ foo: string; __exists?: boolean }> - >(); }); });