/** * Recursively makes all properties in T optional, including nested objects. * Unlike TypeScript's built-in Partial which only affects top-level properties, * DeepPartial applies the optional modifier to all levels of nested objects. * * @template T - The type to make deeply partial * * @example * ```typescript * interface User { * id: number; * profile: { * name: string; * address: { * street: string; * city: string; * }; * }; * } * * type PartialUser = DeepPartial; * // Result: * // { * // id?: number; * // profile?: { * // name?: string; * // address?: { * // street?: string; * // city?: string; * // }; * // }; * // } * ``` */ export type DeepPartial = T extends Record ? { [P in keyof T]?: DeepPartial; } : T;