1 var createObjectMapper = require('../internal/createObjectMapper');
4 * Creates an object with the same keys as `object` and values generated by
5 * running each own enumerable property of `object` through `iteratee`. The
6 * iteratee function is bound to `thisArg` and invoked with three arguments:
7 * (value, key, object).
9 * If a property name is provided for `iteratee` the created `_.property`
10 * style callback returns the property value of the given element.
12 * If a value is also provided for `thisArg` the created `_.matchesProperty`
13 * style callback returns `true` for elements that have a matching property
14 * value, else `false`.
16 * If an object is provided for `iteratee` the created `_.matches` style
17 * callback returns `true` for elements that have the properties of the given
18 * object, else `false`.
23 * @param {Object} object The object to iterate over.
24 * @param {Function|Object|string} [iteratee=_.identity] The function invoked
26 * @param {*} [thisArg] The `this` binding of `iteratee`.
27 * @returns {Object} Returns the new mapped object.
30 * _.mapValues({ 'a': 1, 'b': 2 }, function(n) {
33 * // => { 'a': 3, 'b': 6 }
36 * 'fred': { 'user': 'fred', 'age': 40 },
37 * 'pebbles': { 'user': 'pebbles', 'age': 1 }
40 * // using the `_.property` callback shorthand
41 * _.mapValues(users, 'age');
42 * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)
44 var mapValues = createObjectMapper();
46 module.exports = mapValues;