1 var baseAssignValue = require('./_baseAssignValue'),
2 baseForOwn = require('./_baseForOwn'),
3 baseIteratee = require('./_baseIteratee');
6 * The opposite of `_.mapValues`; this method creates an object with the
7 * same values as `object` and keys generated by running each own enumerable
8 * string keyed property of `object` thru `iteratee`. The iteratee is invoked
9 * with three arguments: (value, key, object).
15 * @param {Object} object The object to iterate over.
16 * @param {Function} [iteratee=_.identity] The function invoked per iteration.
17 * @returns {Object} Returns the new mapped object.
21 * _.mapKeys({ 'a': 1, 'b': 2 }, function(value, key) {
24 * // => { 'a1': 1, 'b2': 2 }
26 function mapKeys(object, iteratee) {
28 iteratee = baseIteratee(iteratee, 3);
30 baseForOwn(object, function(value, key, object) {
31 baseAssignValue(result, iteratee(value, key, object), value);
36 module.exports = mapKeys;