Remove baseIteratee and castFunction.

This commit is contained in:
John-David Dalton
2017-01-09 17:17:03 -08:00
parent efcf51c7bf
commit 65654f8f9e
96 changed files with 140 additions and 537 deletions

View File

@@ -1,6 +1,5 @@
import baseAssignValue from './_baseAssignValue.js';
import baseForOwn from './_baseForOwn.js';
import baseIteratee from './_baseIteratee.js';
/**
* Creates an object with the same keys as `object` and values generated
@@ -13,7 +12,7 @@ import baseIteratee from './_baseIteratee.js';
* @since 2.4.0
* @category Object
* @param {Object} object The object to iterate over.
* @param {Function} [iteratee=_.identity] The function invoked per iteration.
* @param {Function} iteratee The function invoked per iteration.
* @returns {Object} Returns the new mapped object.
* @see _.mapKeys
* @example
@@ -25,15 +24,9 @@ import baseIteratee from './_baseIteratee.js';
*
* _.mapValues(users, function(o) { return o.age; });
* // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)
*
* // The `_.property` iteratee shorthand.
* _.mapValues(users, 'age');
* // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)
*/
function mapValues(object, iteratee) {
const result = {};
iteratee = baseIteratee(iteratee, 3);
baseForOwn(object, (value, key, object) => {
baseAssignValue(result, key, iteratee(value, key, object));
});