1 var mapClear = require('./_mapClear'),
2 mapDelete = require('./_mapDelete'),
3 mapGet = require('./_mapGet'),
4 mapHas = require('./_mapHas'),
5 mapSet = require('./_mapSet');
8 * Creates a map cache object to store key-value pairs.
11 * @param {Array} [values] The values to cache.
13 function MapCache(values) {
15 length = values ? values.length : 0;
18 while (++index < length) {
19 var entry = values[index];
20 this.set(entry[0], entry[1]);
24 // Add functions to the `MapCache`.
25 MapCache.prototype.clear = mapClear;
26 MapCache.prototype['delete'] = mapDelete;
27 MapCache.prototype.get = mapGet;
28 MapCache.prototype.has = mapHas;
29 MapCache.prototype.set = mapSet;
31 module.exports = MapCache;