Bump to v3.8.0.

This commit is contained in:
John-David Dalton
2015-12-16 17:50:05 -08:00
parent fec213a98c
commit 26837e7fe2
58 changed files with 531 additions and 385 deletions

View File

@@ -0,0 +1,26 @@
define(['./baseCallback', './baseForOwn'], function(baseCallback, baseForOwn) {
/**
* Creates a function for `_.mapKeys` or `_.mapValues`.
*
* @private
* @param {boolean} [isMapKeys] Specify mapping keys instead of values.
* @returns {Function} Returns the new map function.
*/
function createObjectMapper(isMapKeys) {
return function(object, iteratee, thisArg) {
var result = {};
iteratee = baseCallback(iteratee, thisArg, 3);
baseForOwn(object, function(value, key, object) {
var mapped = iteratee(value, key, object);
key = isMapKeys ? mapped : key;
value = isMapKeys ? value : mapped;
result[key] = value;
});
return result;
};
}
return createObjectMapper;
});