UNPKG

rambda

Version:

Lightweight and faster alternative to Ramda with included TS definitions

14 lines (11 loc) 242 B
export function filterObject(predicate) { return obj => { const willReturn = {} for (const prop in obj) { if (predicate(obj[prop], prop, obj)) { willReturn[prop] = obj[prop] } } return willReturn } }