summaryrefslogtreecommitdiff
path: root/tools/eslint/node_modules/lodash/_cacheHas.js
diff options
context:
space:
mode:
Diffstat (limited to 'tools/eslint/node_modules/lodash/_cacheHas.js')
-rw-r--r--tools/eslint/node_modules/lodash/_cacheHas.js25
1 files changed, 25 insertions, 0 deletions
diff --git a/tools/eslint/node_modules/lodash/_cacheHas.js b/tools/eslint/node_modules/lodash/_cacheHas.js
new file mode 100644
index 0000000000..7f2ac48476
--- /dev/null
+++ b/tools/eslint/node_modules/lodash/_cacheHas.js
@@ -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;