mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-31 17:38:48 +00:00
react app
This commit is contained in:
26
react-app/node_modules/lodash/internal/createObjectMapper.js
generated
vendored
Normal file
26
react-app/node_modules/lodash/internal/createObjectMapper.js
generated
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
var baseCallback = require('./baseCallback'),
|
||||
baseForOwn = require('./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;
|
||||
};
|
||||
}
|
||||
|
||||
module.exports = createObjectMapper;
|
Reference in New Issue
Block a user