diff --git a/packages/repository/src/common-types.ts b/packages/repository/src/common-types.ts index 2d4d5a3860ab..df640c5553a6 100644 --- a/packages/repository/src/common-types.ts +++ b/packages/repository/src/common-types.ts @@ -49,7 +49,11 @@ export interface AnyObject { * An extension of the built-in Partial type which allows partial values * in deeply nested properties too. */ -export type DeepPartial = {[P in keyof T]?: DeepPartial}; +// FIXME(rfeng): https://github.com/microsoft/TypeScript/issues/21592#issuecomment-496723647 +// export type DeepPartial = {[P in keyof T]?: DeepPartial}; +export type DeepPartial = { + [P in keyof T]?: T[P] extends never ? DeepPartial : DeepPartial; +}; /** * Type alias for strongly or weakly typed objects of T