"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = filterObject;

function _foreach() {
  const data = _interopRequireDefault(require("./object/foreach"));

  _foreach = function () {
    return data;
  };

  return data;
}

/**
 *
 */
function filterObject(obj, fn) {
  const newObj = {};
  (0, _foreach().default)(obj, (val, key) => {
    if (fn(val, key)) newObj[key] = val;
  });
  return newObj;
}