UNPKG

732 BJavaScriptView Raw
1import ListCache from './_ListCache.js';
2import stackClear from './_stackClear.js';
3import stackDelete from './_stackDelete.js';
4import stackGet from './_stackGet.js';
5import stackHas from './_stackHas.js';
6import stackSet from './_stackSet.js';
7
8/**
9 * Creates a stack cache object to store key-value pairs.
10 *
11 * @private
12 * @constructor
13 * @param {Array} [entries] The key-value pairs to cache.
14 */
15function Stack(entries) {
16 var data = this.__data__ = new ListCache(entries);
17 this.size = data.size;
18}
19
20// Add methods to `Stack`.
21Stack.prototype.clear = stackClear;
22Stack.prototype['delete'] = stackDelete;
23Stack.prototype.get = stackGet;
24Stack.prototype.has = stackHas;
25Stack.prototype.set = stackSet;
26
27export default Stack;