UNPKG

es-toolkit

Version:

A state-of-the-art, high-performance JavaScript utility library with a small bundle size and strong type annotations.

15 lines (13 loc) 326 B
function pickBy(obj, shouldPick) { const result = {}; const keys = Object.keys(obj); for (let i = 0; i < keys.length; i++) { const key = keys[i]; const value = obj[key]; if (shouldPick(value, key)) { result[key] = value; } } return result; } export { pickBy };