Filter and exclude specific keys from an object (Based on https://github.com/sindresorhus/filter-obj)
The object to filter and exclude keys from
The key type
The keys or keysCallback to exclude from the object
A new object with the excluded keys
const object = { foo: true, bar: false};const newObject = excludeKeys(object, (key, value) => value === true); //=> {bar: false}const newObject = excludeKeys(object, ['bar']); //=> {foo: true} Copy
const object = { foo: true, bar: false};const newObject = excludeKeys(object, (key, value) => value === true); //=> {bar: false}const newObject = excludeKeys(object, ['bar']); //=> {foo: true}
v0.2.8
Filter and exclude specific keys from an object (Based on https://github.com/sindresorhus/filter-obj)