All files / src/utils omit.js

100% Statements 1/1
100% Branches 2/2
100% Functions 1/1
100% Lines 1/1
1 2 3 4 5 6 7 8 9 10 11    381x                
// Return a copy of the object, filtered to omit the blacklisted array of keys.
export default function omit (obj, blackList) {
  var newObj = {}
  Object.keys(obj || {}).forEach(key => {
    if (blackList.indexOf(key) === -1) {
      newObj[key] = obj[key]
    }
  })
  return newObj
}