Extract<T, U>

The utility type that keeps only the members of union T that are assignable to U.

In more detail

Extract<HttpMethod, "GET"> leaves just "GET". It is the mirror image of Exclude.

Related terms

Taught in

References