MCPcopy
hub / github.com/lodash/lodash / mapKeys

Function mapKeys

lodash.js:13457–13465  ·  view source on GitHub ↗

* The opposite of `_.mapValues`; this method creates an object with the * same values as `object` and keys generated by running each own enumerable * string keyed property of `object` thru `iteratee`. The iteratee is invoked * with three arguments: (value, key, object). * *

(object, iteratee)

Source from the content-addressed store, hash-verified

13455 * // => { 'a1': 1, 'b2': 2 }
13456 */
13457 function mapKeys(object, iteratee) {
13458 var result = {};
13459 iteratee = getIteratee(iteratee, 3);
13460
13461 baseForOwn(object, function(value, key, object) {
13462 baseAssignValue(result, iteratee(value, key, object), value);
13463 });
13464 return result;
13465 }
13466
13467 /**
13468 * Creates an object with the same keys as `object` and values generated

Callers

nothing calls this directly

Calls 4

getIterateeFunction · 0.85
baseForOwnFunction · 0.85
baseAssignValueFunction · 0.85
iterateeFunction · 0.70

Tested by

no test coverage detected