All files / atom/tag/src helpers.js

100% Statements 5/5
100% Branches 2/2
100% Functions 2/2
100% Lines 5/5

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14            1x 13x 187x 147x   187x    
/**
 * returns key:value in obj except for those keys defined in props
 * @param {Object} obj
 * @param {Array.<string>} props
 * @return {Object}
 */
export const filterKeys = (obj, listOfProps) =>
  Object.keys(obj).reduce((acc, key) => {
    if (listOfProps.indexOf(key) === -1) {
      acc[key] = obj[key]
    }
    return acc
  }, {})