1 var baseCallback = require('./baseCallback'),
2 baseForOwn = require('./baseForOwn');
5 * Creates a function for `_.mapKeys` or `_.mapValues`.
8 * @param {boolean} [isMapKeys] Specify mapping keys instead of values.
9 * @returns {Function} Returns the new map function.
11 function createObjectMapper(isMapKeys) {
12 return function(object, iteratee, thisArg) {
14 iteratee = baseCallback(iteratee, thisArg, 3);
16 baseForOwn(object, function(value, key, object) {
17 var mapped = iteratee(value, key, object);
18 key = isMapKeys ? mapped : key;
19 value = isMapKeys ? value : mapped;
26 module.exports = createObjectMapper;