mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-02 16:17:50 +00:00
Bump to v4.12.0.
This commit is contained in:
28
_MapCache.js
28
_MapCache.js
@@ -1,32 +1,32 @@
|
||||
import mapClear from './_mapClear';
|
||||
import mapDelete from './_mapDelete';
|
||||
import mapGet from './_mapGet';
|
||||
import mapHas from './_mapHas';
|
||||
import mapSet from './_mapSet';
|
||||
import mapCacheClear from './_mapCacheClear';
|
||||
import mapCacheDelete from './_mapCacheDelete';
|
||||
import mapCacheGet from './_mapCacheGet';
|
||||
import mapCacheHas from './_mapCacheHas';
|
||||
import mapCacheSet from './_mapCacheSet';
|
||||
|
||||
/**
|
||||
* Creates a map cache object to store key-value pairs.
|
||||
*
|
||||
* @private
|
||||
* @constructor
|
||||
* @param {Array} [values] The values to cache.
|
||||
* @param {Array} [entries] The key-value pairs to cache.
|
||||
*/
|
||||
function MapCache(values) {
|
||||
function MapCache(entries) {
|
||||
var index = -1,
|
||||
length = values ? values.length : 0;
|
||||
length = entries ? entries.length : 0;
|
||||
|
||||
this.clear();
|
||||
while (++index < length) {
|
||||
var entry = values[index];
|
||||
var entry = entries[index];
|
||||
this.set(entry[0], entry[1]);
|
||||
}
|
||||
}
|
||||
|
||||
// Add methods to `MapCache`.
|
||||
MapCache.prototype.clear = mapClear;
|
||||
MapCache.prototype['delete'] = mapDelete;
|
||||
MapCache.prototype.get = mapGet;
|
||||
MapCache.prototype.has = mapHas;
|
||||
MapCache.prototype.set = mapSet;
|
||||
MapCache.prototype.clear = mapCacheClear;
|
||||
MapCache.prototype['delete'] = mapCacheDelete;
|
||||
MapCache.prototype.get = mapCacheGet;
|
||||
MapCache.prototype.has = mapCacheHas;
|
||||
MapCache.prototype.set = mapCacheSet;
|
||||
|
||||
export default MapCache;
|
||||
|
||||
Reference in New Issue
Block a user