Packages

A web application in pursuit of meaning in life.

Retired package: Complete rewrite, scratch old versions

Current section

Files

Jump to
udia assets node_modules mout src object map.js
Raw

assets/node_modules/mout/src/object/map.js

define(['./forOwn', '../function/makeIterator_'], function(forOwn, makeIterator) {
/**
* Creates a new object where all the values are the result of calling
* `callback`.
*/
function mapValues(obj, callback, thisObj) {
callback = makeIterator(callback, thisObj);
var output = {};
forOwn(obj, function(val, key, obj) {
output[key] = callback(val, key, obj);
});
return output;
}
return mapValues;
});