Version 1
[yaffs-website] / node_modules / uncss / node_modules / lodash / internal / cacheHas.js
diff --git a/node_modules/uncss/node_modules/lodash/internal/cacheHas.js b/node_modules/uncss/node_modules/lodash/internal/cacheHas.js
new file mode 100644 (file)
index 0000000..e708562
--- /dev/null
@@ -0,0 +1,25 @@
+var isKeyable = require('./isKeyable');
+
+/** Used to stand-in for `undefined` hash values. */
+var HASH_UNDEFINED = '__lodash_hash_undefined__';
+
+/**
+ * Checks if `value` is in `cache`.
+ *
+ * @private
+ * @param {Object} cache The set cache to search.
+ * @param {*} value The value to search for.
+ * @returns {number} Returns `true` if `value` is found, else `false`.
+ */
+function cacheHas(cache, value) {
+  var map = cache.__data__;
+  if (isKeyable(value)) {
+    var data = map.__data__,
+        hash = typeof value == 'string' ? data.string : data.hash;
+
+    return hash[value] === HASH_UNDEFINED;
+  }
+  return map.has(value);
+}
+
+module.exports = cacheHas;