Version 1
[yaffs-website] / node_modules / uncss / node_modules / lodash / internal / mapSet.js
diff --git a/node_modules/uncss/node_modules/lodash/internal/mapSet.js b/node_modules/uncss/node_modules/lodash/internal/mapSet.js
new file mode 100644 (file)
index 0000000..43a6463
--- /dev/null
@@ -0,0 +1,28 @@
+var Map = require('./Map'),
+    assocSet = require('./assocSet'),
+    hashSet = require('./hashSet'),
+    isKeyable = require('./isKeyable');
+
+/**
+ * Sets the map `key` to `value`.
+ *
+ * @private
+ * @name set
+ * @memberOf MapCache
+ * @param {string} key The key of the value to set.
+ * @param {*} value The value to set.
+ * @returns {Object} Returns the map cache object.
+ */
+function mapSet(key, value) {
+  var data = this.__data__;
+  if (isKeyable(key)) {
+    hashSet(typeof key == 'string' ? data.string : data.hash, key, value);
+  } else if (Map) {
+    data.map.set(key, value);
+  } else {
+    assocSet(data.map, key, value);
+  }
+  return this;
+}
+
+module.exports = mapSet;