mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-02 16:17:50 +00:00
Apply class transform.
This commit is contained in:
16
_MapCache.js
16
_MapCache.js
@@ -11,14 +11,16 @@ import mapCacheSet from './_mapCacheSet.js';
|
||||
* @constructor
|
||||
* @param {Array} [entries] The key-value pairs to cache.
|
||||
*/
|
||||
function MapCache(entries) {
|
||||
let index = -1;
|
||||
const length = entries == null ? 0 : entries.length;
|
||||
class MapCache {
|
||||
constructor(entries) {
|
||||
let index = -1;
|
||||
const length = entries == null ? 0 : entries.length;
|
||||
|
||||
this.clear();
|
||||
while (++index < length) {
|
||||
const entry = entries[index];
|
||||
this.set(entry[0], entry[1]);
|
||||
this.clear();
|
||||
while (++index < length) {
|
||||
const entry = entries[index];
|
||||
this.set(entry[0], entry[1]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user