@jossmac/lil-libs
    Preparing search index...

    Type Alias SomeOptional<T, K>

    SomeOptional: Prettify<Partial<Pick<T, K>> & Omit<T, K>>

    Makes the keys in K optional; all other keys keep their original optionality and value types.

    Type Parameters

    • T

      Source object type.

    • K extends keyof T

      Keys to make optional.

    type Input = { id: string; name: string; active: boolean };
    type Output = SomeOptional<Input, "active">;
    // ^? { id: string; name: string; active?: boolean }