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.
1 parent 18c4e0b commit 83b0852Copy full SHA for 83b0852
src/interface.ts
@@ -231,12 +231,14 @@ export interface InternalHooks {
231
getInitialValue: (namePath: InternalNamePath) => StoreValue;
232
}
233
234
+type NoUndefined<T> = Exclude<T, undefined>;
235
+
236
/** Only return partial when type is not any */
-type RecursivePartial<T> = NonNullable<T> extends object
237
+type RecursivePartial<T> = NoUndefined<T> extends object
238
? {
- [P in keyof T]?: NonNullable<T[P]> extends (infer U)[]
239
+ [P in keyof T]?: NoUndefined<T[P]> extends (infer U)[]
240
? RecursivePartial<U>[]
- : NonNullable<T[P]> extends object
241
+ : NoUndefined<T[P]> extends object
242
? RecursivePartial<T[P]>
243
: T[P];
244
0 commit comments