DeepPartial<T>: { [ P in keyof T]?: T[P] extends (infer U)[] ? DeepPartial<U>[] : T[P] extends Readonly<infer U>[] ? Readonly<DeepPartial<U>>[] : DeepPartial<T[P]> }

Makes all properties of a type optional, along with sub-properties recursively. Source: https://stackoverflow.com/a/49936686/3248302

Type Parameters

  • T