Current section

Files

Jump to
udia assets node_modules mout object map.js
Raw

assets/node_modules/mout/object/map.js

var forOwn = require('./forOwn');
var makeIterator = require('../function/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;
}
module.exports = mapValues;