Version 1
[yaffs-website] / node_modules / grunt-legacy-util / node_modules / lodash / _cloneMap.js
diff --git a/node_modules/grunt-legacy-util/node_modules/lodash/_cloneMap.js b/node_modules/grunt-legacy-util/node_modules/lodash/_cloneMap.js
new file mode 100644 (file)
index 0000000..1b5af07
--- /dev/null
@@ -0,0 +1,17 @@
+var addMapEntry = require('./_addMapEntry'),
+    arrayReduce = require('./_arrayReduce'),
+    mapToArray = require('./_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);
+}
+
+module.exports = cloneMap;