react / wstein / node_modules / jest-cli / node_modules / istanbul / node_modules / js-yaml / node_modules / argparse / node_modules / lodash / object / mapValues.js
80742 viewsvar createObjectMapper = require('../internal/createObjectMapper');12/**3* Creates an object with the same keys as `object` and values generated by4* running each own enumerable property of `object` through `iteratee`. The5* iteratee function is bound to `thisArg` and invoked with three arguments:6* (value, key, object).7*8* If a property name is provided for `iteratee` the created `_.property`9* style callback returns the property value of the given element.10*11* If a value is also provided for `thisArg` the created `_.matchesProperty`12* style callback returns `true` for elements that have a matching property13* value, else `false`.14*15* If an object is provided for `iteratee` the created `_.matches` style16* callback returns `true` for elements that have the properties of the given17* object, else `false`.18*19* @static20* @memberOf _21* @category Object22* @param {Object} object The object to iterate over.23* @param {Function|Object|string} [iteratee=_.identity] The function invoked24* per iteration.25* @param {*} [thisArg] The `this` binding of `iteratee`.26* @returns {Object} Returns the new mapped object.27* @example28*29* _.mapValues({ 'a': 1, 'b': 2 }, function(n) {30* return n * 3;31* });32* // => { 'a': 3, 'b': 6 }33*34* var users = {35* 'fred': { 'user': 'fred', 'age': 40 },36* 'pebbles': { 'user': 'pebbles', 'age': 1 }37* };38*39* // using the `_.property` callback shorthand40* _.mapValues(users, 'age');41* // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)42*/43var mapValues = createObjectMapper();4445module.exports = mapValues;464748