Version 1
[yaffs-website] / node_modules / grunt-legacy-util / node_modules / lodash / _mapHas.js
diff --git a/node_modules/grunt-legacy-util/node_modules/lodash/_mapHas.js b/node_modules/grunt-legacy-util/node_modules/lodash/_mapHas.js
new file mode 100644 (file)
index 0000000..9225537
--- /dev/null
@@ -0,0 +1,23 @@
+var Map = require('./_Map'),
+    assocHas = require('./_assocHas'),
+    hashHas = require('./_hashHas'),
+    isKeyable = require('./_isKeyable');
+
+/**
+ * Checks if a map value for `key` exists.
+ *
+ * @private
+ * @name has
+ * @memberOf MapCache
+ * @param {string} key The key of the entry to check.
+ * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
+ */
+function mapHas(key) {
+  var data = this.__data__;
+  if (isKeyable(key)) {
+    return hashHas(typeof key == 'string' ? data.string : data.hash, key);
+  }
+  return Map ? data.map.has(key) : assocHas(data.map, key);
+}
+
+module.exports = mapHas;