type UnionLast<T> = UnionToIntersection<T extends T ? Fn<[], T> : never> extends Fn<[], infer Result> ? Result : never;Extracts the last type from a union type.
| Type Parameter | Description |
|---|---|
|
|
The union type. |
The last type in the union.
// 'c'
type Last = UnionLast<'a' | 'b' | 'c'>;