diff --git a/src/interface.ts b/src/interface.ts index c01f0839..fa2ef089 100644 --- a/src/interface.ts +++ b/src/interface.ts @@ -210,16 +210,15 @@ export interface InternalHooks { getInitialValue: (namePath: InternalNamePath) => StoreValue; } -/** Only return partial when type is not any */ -type RecursivePartial = T extends object - ? { - [P in keyof T]?: T[P] extends (infer U)[] - ? RecursivePartial[] - : T[P] extends object - ? RecursivePartial - : T[P]; - } - : any; +type Primitive = number | string | boolean | bigint | symbol | undefined | null + +type RecursivePartial = { + [P in keyof T]?: T[P] extends Primitive + ? T[P] + : T[P] extends (infer U)[] + ? RecursivePartial[] + : RecursivePartial +} export interface FormInstance { // Origin Form API