summaryrefslogtreecommitdiff
path: root/tools/eslint/node_modules/lodash/_cachePush.js
diff options
context:
space:
mode:
Diffstat (limited to 'tools/eslint/node_modules/lodash/_cachePush.js')
-rw-r--r--tools/eslint/node_modules/lodash/_cachePush.js27
1 files changed, 27 insertions, 0 deletions
diff --git a/tools/eslint/node_modules/lodash/_cachePush.js b/tools/eslint/node_modules/lodash/_cachePush.js
new file mode 100644
index 0000000000..638383b641
--- /dev/null
+++ b/tools/eslint/node_modules/lodash/_cachePush.js
@@ -0,0 +1,27 @@
+var isKeyable = require('./_isKeyable');
+
+/** Used to stand-in for `undefined` hash values. */
+var HASH_UNDEFINED = '__lodash_hash_undefined__';
+
+/**
+ * Adds `value` to the set cache.
+ *
+ * @private
+ * @name push
+ * @memberOf SetCache
+ * @param {*} value The value to cache.
+ */
+function cachePush(value) {
+ var map = this.__data__;
+ if (isKeyable(value)) {
+ var data = map.__data__,
+ hash = typeof value == 'string' ? data.string : data.hash;
+
+ hash[value] = HASH_UNDEFINED;
+ }
+ else {
+ map.set(value, HASH_UNDEFINED);
+ }
+}
+
+module.exports = cachePush;