Pick properties by their value type.
The object type to filter
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 } Copy
type Obj = { a: number; b: string; c: number; d: boolean };type NumProps = PickByValue< Obj, number >; // { a: number; c: number }
Pick properties by their value type.