lodash
Version:
Lodash modular utilities.
25 lines (20 loc) • 496 B
JavaScript
var MapCache = require('./MapCache'),
cachePush = require('./cachePush');
/**
*
* Creates a set cache object to store unique values.
*
* @private
* @param {Array} [values] The values to cache.
*/
function SetCache(values) {
var index = -1,
length = values ? values.length : 0;
this.__data__ = new MapCache;
while (++index < length) {
this.push(values[index]);
}
}
// Add functions to the `SetCache`.
SetCache.prototype.push = cachePush;
module.exports = SetCache;