Skip to content

Commit

Permalink
feat: don't exclude fields starting with __
Browse files Browse the repository at this point in the history
  • Loading branch information
Julian Schleemann committed Feb 20, 2024
1 parent 334a6d4 commit 3409b68
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 6 deletions.
2 changes: 1 addition & 1 deletion src/formbuilder.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ export type FormBuilder<T> = FormBuilderRegisterFn<T> & {
): $UseFieldArrayReturn<TItem>;
}
: {
[K in Exclude<keyof T, `${"__"}${string}`>]-?: FormBuilder<
[K in keyof T]-?: FormBuilder<
T[K] extends Primitive ? T[K] : NonNullable<T[K]>
>;
});
Expand Down
5 changes: 0 additions & 5 deletions src/types.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -132,10 +132,5 @@ describe("Types", () => {
expectTypeOf<FormBuilder<"one" | "two">>().toMatchTypeOf<
FormBuilder<string>
>();

// Ignored prefixes
expectTypeOf<FormBuilder<{ foo: string }>>().toMatchTypeOf<
FormBuilder<{ foo: string; __exists?: boolean }>
>();
});
});

0 comments on commit 3409b68

Please sign in to comment.