1234567891011 |
- 'use strict'
- module.exports = function objFilter (original, filter) {
- const obj = {}
- filter = filter || ((k, v) => true)
- Object.keys(original || {}).forEach((key) => {
- if (filter(key, original[key])) {
- obj[key] = original[key]
- }
- })
- return obj
- }
|