MakeOptional<T, U>: {
    [P in keyof T as P extends U
        ? never
        : P]: T[P]
} & Partial<Pick<T, U>>

Makes specified properties of T optional.

Type Parameters

  • T extends object

    The type to make properties optional.

  • U extends keyof T

    The properties to make optional.