1 var baseForOwn = require('./internal/baseForOwn'),
2 baseIteratee = require('./internal/baseIteratee');
5 * The opposite of `_.mapValues`; this method creates an object with the
6 * same values as `object` and keys generated by running each own enumerable
7 * property of `object` through `iteratee`.
12 * @param {Object} object The object to iterate over.
13 * @param {Function|Object|string} [iteratee=_.identity] The function invoked per iteration.
14 * @returns {Object} Returns the new mapped object.
17 * _.mapKeys({ 'a': 1, 'b': 2 }, function(value, key) {
20 * // => { 'a1': 1, 'b2': 2 }
22 function mapKeys(object, iteratee) {
24 iteratee = baseIteratee(iteratee, 3);
26 baseForOwn(object, function(value, key, object) {
27 result[iteratee(value, key, object)] = value;
32 module.exports = mapKeys;