The target type to make deeply partial.
DeepPartial.null is assignable to the type, it remains allowed.class User {
id: string;
profile: {
name: string;
age: number;
};
tags: string[];
}
// The resulting type:
// {
// id?: string;
// profile?: { name?: string; age?: number };
// tags?: (string | undefined)[];
// }
type PartialUser = DeepPartial<User>;
const patch: PartialUser = {
profile: { age: 30 } // ok
};
Recursively makes all properties of a type optional, including nested objects and arrays.