1 var cachePush = require('./cachePush'),
2 getNative = require('./getNative');
4 /** Native method references. */
5 var Set = getNative(global, 'Set');
7 /* Native method references for those with the same name as other `lodash` methods. */
8 var nativeCreate = getNative(Object, 'create');
12 * Creates a cache object to store unique values.
15 * @param {Array} [values] The values to cache.
17 function SetCache(values) {
18 var length = values ? values.length : 0;
20 this.data = { 'hash': nativeCreate(null), 'set': new Set };
22 this.push(values[length]);
26 // Add functions to the `Set` cache.
27 SetCache.prototype.push = cachePush;
29 module.exports = SetCache;