diff --git a/js/core/index.d.ts b/js/core/index.d.ts index 9ddfc76eb0a3..c5d0a603569e 100644 --- a/js/core/index.d.ts +++ b/js/core/index.d.ts @@ -19,9 +19,10 @@ export type Xor> | Seal>; -export type DeepPartial = T extends Record ? { +type Scalar = string | number | Function | Date | Boolean | Array; +export type DeepPartial = T extends Scalar ? T : { [P in keyof T]?: DeepPartial; -} : T; +}; type ItemType = T extends (infer TItem)[] ? TItem : T; type Property = T extends Partial> ? TValue : never;