"use strict";

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


/**
 * Returns the results of applying the iteratee to each element of the object.
 * @param {object} object
 * @param {function(val, key)} iteratee
 * @returns {object}
 * @example
 * ```js
 * const newObj = mapObject({ start: 5, end: 12 }, function(val, key) {
 *   return val + 5;
 * });
 * console.log(newObj) //  { start: 10, end: 17 }
 * ```
 */
function mapObject(obj, iteratee) {
  var keys = Object.keys(obj);
  var mappedObject = {};

  keys.forEach(function (key) {
    mappedObject[key] = iteratee(obj[key], key);
  });

  return mappedObject;
}