mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-03 08:37:49 +00:00
Bump to v4.0.0.
This commit is contained in:
17
internal/cloneMap.js
Normal file
17
internal/cloneMap.js
Normal file
@@ -0,0 +1,17 @@
|
||||
import addMapEntry from './addMapEntry';
|
||||
import arrayReduce from './arrayReduce';
|
||||
import mapToArray from './mapToArray';
|
||||
|
||||
/**
|
||||
* Creates a clone of `map`.
|
||||
*
|
||||
* @private
|
||||
* @param {Object} map The map to clone.
|
||||
* @returns {Object} Returns the cloned map.
|
||||
*/
|
||||
function cloneMap(map) {
|
||||
var Ctor = map.constructor;
|
||||
return arrayReduce(mapToArray(map), addMapEntry, new Ctor);
|
||||
}
|
||||
|
||||
export default cloneMap;
|
||||
Reference in New Issue
Block a user