MCPcopy
hub / github.com/jashkenas/underscore / mapObject

Function mapObject

underscore-node-f.cjs:784–794  ·  view source on GitHub ↗
(obj, iteratee, context)

Source from the content-addressed store, hash-verified

782// Returns the results of applying the `iteratee` to each element of `obj`.
783// In contrast to `_.map` it returns an object.
784function mapObject(obj, iteratee, context) {
785 iteratee = cb(iteratee, context);
786 var _keys = keys(obj),
787 length = _keys.length,
788 results = {};
789 for (var index = 0; index < length; index++) {
790 var currentKey = _keys[index];
791 results[currentKey] = iteratee(obj[currentKey], currentKey, obj);
792 }
793 return results;
794}
795
796// Predicate-generating function. Often useful outside of Underscore.
797function noop(){}

Callers

nothing calls this directly

Calls 3

cbFunction · 0.70
keysFunction · 0.70
iterateeFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…