pickBy es-toolkit
Returns a new object containing only the properties that satisfy the condition function.
Usage
pickBy(obj, shouldPick)
Use pickBy when you want to selectively pick properties from an object based on a condition function. Only properties for which the condition function returns true are included in the new object.
Parameters
The object to filter properties from.
A condition function that determines whether to pick a property. Receives the value and key, and returns true to pick, false to exclude. Numeric keys are passed to the condition function as strings (see ObjectKeys<T>).
Returns
A new object containing only the properties that satisfy the condition function.
Source: es-toolkit
Re-exported verbatim from es-toolkit. Implementation, edge cases, and performance behavior are owned upstream. This page mirrors the documentation at the pinned version; the linked source is authoritative.