• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1'use strict'
2module.exports = function objFilter (original, filter) {
3  const obj = {}
4  filter = filter || ((k, v) => true)
5  Object.keys(original || {}).forEach((key) => {
6    if (filter(key, original[key])) {
7      obj[key] = original[key]
8    }
9  })
10  return obj
11}
12