basant307/AI_Governance_Project
045
1import mapCacheClear from './_mapCacheClear.js';2import mapCacheDelete from './_mapCacheDelete.js';3import mapCacheGet from './_mapCacheGet.js';4import mapCacheHas from './_mapCacheHas.js';5import mapCacheSet from './_mapCacheSet.js';6 7/**8 * Creates a map cache object to store key-value pairs.9 *10 * @private11 * @constructor12 * @param {Array} [entries] The key-value pairs to cache.13 */14function MapCache(entries) {15 var index = -1,16 length = entries == null ? 0 : entries.length;17 18 this.clear();19 while (++index < length) {20 var entry = entries[index];21 this.set(entry[0], entry[1]);22 }23}24 25// Add methods to `MapCache`.26MapCache.prototype.clear = mapCacheClear;27MapCache.prototype['delete'] = mapCacheDelete;28MapCache.prototype.get = mapCacheGet;29MapCache.prototype.has = mapCacheHas;30MapCache.prototype.set = mapCacheSet;31 32export default MapCache;33 