devtypes - v1.1.0
    Preparing search index...

    Type Alias PickByValue<T, V>

    PickByValue: Pick<T, KeysByValue<T, V>>

    Pick properties by their value type.

    Type Parameters

    • T

      The object type to filter

    • V

      The value type to match

    Creates a new type containing only properties whose values match the specified type. Useful for extracting numeric, string, or other specific property subsets.

    type Obj = { a: number; b: string; c: number; d: boolean };
    type NumProps = PickByValue< Obj, number >; // { a: number; c: number }