MCPcopy
hub / github.com/stemkoski/stemkoski.github.com / mapValues

Function mapValues

MathBox/mathbox-bundle.js:37751–37759  ·  view source on GitHub ↗

* Creates an object with the same keys as `object` and values generated by * running each own enumerable property of `object` through the callback. * The callback is bound to `thisArg` and invoked with three arguments; * (value, key, object). * * If a property name is provid

(object, callback, thisArg)

Source from the content-addressed store, hash-verified

37749 * // => { 'fred': 40, 'pebbles': 1 }
37750 */
37751 function mapValues(object, callback, thisArg) {
37752 var result = {};
37753 callback = lodash.createCallback(callback, thisArg, 3);
37754
37755 forOwn(object, function(value, key, object) {
37756 result[key] = callback(value, key, object);
37757 });
37758 return result;
37759 }
37760
37761 /**
37762 * Recursively merges own enumerable properties of the source object(s), that

Callers

nothing calls this directly

Calls 2

forOwnFunction · 0.85
callbackFunction · 0.70

Tested by

no test coverage detected