Type alias PopUnion<Union>

PopUnion<Union>: _UnionToFn<Union> extends ((a) => void)
    ? Argument
    : Union

PopUnion

Type Parameters

  • Union

    The union to remove the last item from

Desc

Remove the last item from a union

Returns

The union without the last item

Example

type Union = { a: string } | { b: number };
type Pop = PopUnion<Union>; // { b: number }