devtypes - v1.1.0
    Preparing search index...

    Type Alias UnionPick<U, T>

    UnionPick: U extends T ? U : never

    Pick specific members from a union by type.

    Type Parameters

    • U

      A union type

    • T

      The type to match union members against

    1.1.0

    Extracts only the union members that extend a given type. Useful for filtering union types without modifying the original type.

    type U = string | number | boolean | null;
    type Filtered = UnionPick< U, string | number >; // string | number