MCPcopy Create free account
hub / github.com/RubyLouvre/anu / cloneMap

Function cloneMap

test/babel.js:52275–52278  ·  view source on GitHub ↗

* Creates a clone of `map`. * * @private * @param {Object} map The map to clone. * @param {Function} cloneFunc The function to clone values. * @param {boolean} [isDeep] Specify a deep clone. * @returns {Object} Returns the cloned map.

(map, isDeep, cloneFunc)

Source from the content-addressed store, hash-verified

52273 * @returns {Object} Returns the cloned map.
52274 */
52275 function cloneMap(map, isDeep, cloneFunc) {
52276 var array = isDeep ? cloneFunc(mapToArray(map), CLONE_DEEP_FLAG) : mapToArray(map);
52277 return arrayReduce(array, addMapEntry, new map.constructor());
52278 }
52279
52280 module.exports = cloneMap;
52281

Callers 1

initCloneByTagFunction · 0.85

Calls 2

mapToArrayFunction · 0.85
arrayReduceFunction · 0.85

Tested by

no test coverage detected