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
objT extends Record<string, any>required
The object to filter properties from.
shouldPick(value: T[keyof T], key: keyof T) => booleanrequired
A condition function that determines whether to pick a property. Receives the value and key, and returns true to pick, false to exclude.
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.