Files
2025-11-28 19:45:44 -07:00

15 lines
326 B
JavaScript

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 };