Cloesce - v0.0.5-unstable.27
    Preparing search index...

    Type Alias DeepPartial<T>

    DeepPartial: DeepPartialInner<T> & { __brand?: "Partial" }

    Recursively makes all properties of a type optional, including nested objects and arrays.

    Type Parameters

    • T

      The target type to make deeply partial.

    • Objects: All properties become optional, and their values are recursively wrapped in DeepPartial.
    • Arrays: Arrays are preserved, but their elements are recursively made partial.
    • Scalars: Primitive values (string, number, boolean, etc.) remain unchanged.
    • Nullable types: If 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
    };