TS-Scribe - v0.6.2
    Preparing search index...

    Type Alias SmartPartial<T>

    SmartPartial: Simplify<
        UnionToIntersection<
            {
                [P in keyof T]: undefined extends T[P]
                    ? Partial<Record<P, T[P]>>
                    : Record<P, T[P]>
            }[keyof T],
        >,
    >

    Creates a type where the properties of an object are made optional, but only for those properties that can accept undefined as a valid value. This is useful for scenarios where a partial version of an object is allowed, but only for properties that are explicitly nullable.

    Type Parameters

    • T

      The object type to apply the smart partial transformation to.