Removed modules/contrib/media module to allow update to the core media module
[yaffs-website] / node_modules / uncss / node_modules / lodash / internal / MapCache.js
1 var mapClear = require('./mapClear'),
2     mapDelete = require('./mapDelete'),
3     mapGet = require('./mapGet'),
4     mapHas = require('./mapHas'),
5     mapSet = require('./mapSet');
6
7 /**
8  * Creates a map cache object to store key-value pairs.
9  *
10  * @private
11  * @param {Array} [values] The values to cache.
12  */
13 function MapCache(values) {
14   var index = -1,
15       length = values ? values.length : 0;
16
17   this.clear();
18   while (++index < length) {
19     var entry = values[index];
20     this.set(entry[0], entry[1]);
21   }
22 }
23
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;
30
31 module.exports = MapCache;