mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-04 00:57:48 +00:00
Bump to v4.1.0.
This commit is contained in:
17
_cloneMap.js
Normal file
17
_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