devtypes - v1.1.0
    Preparing search index...

    Type Alias DeepPartial<T>

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

    Recursively make all properties optional.

    Type Parameters

    Traverses objects and arrays and applies optional modifiers at every nesting level without altering value types.

    type User = { id: number; profile: { name: string; address: { city: string } } };
    type PartialUser = DeepPartial< User >;
    // { id?: number; profile?: { name?: string; address?: { city?: string } } }