1.0.0 • Published 4 years ago
@foodelevator/filter-object v1.0.0
filterObject
Filters objects by a list of keys. Does not support regular expressions, globs or anything like that.
Examples
filterObject({ a: 1, b: 1, c: 1 }, ["a", "b"]); // => { a: 1, b: 1 }
filterObject({ a: 1, b: 2, c: 4 }, ["c", "d"]); // => { c: 4 }
filterObject(anyObject, []); // => {}
filterObject({}, anyArrayOfStrings); // => {}
1.0.0
4 years ago