mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-15 13:17:50 +00:00
Apply class transform.
This commit is contained in:
4
_Hash.js
4
_Hash.js
@@ -11,7 +11,8 @@ import hashSet from './_hashSet.js';
|
||||
* @constructor
|
||||
* @param {Array} [entries] The key-value pairs to cache.
|
||||
*/
|
||||
function Hash(entries) {
|
||||
class Hash {
|
||||
constructor(entries) {
|
||||
let index = -1;
|
||||
const length = entries == null ? 0 : entries.length;
|
||||
|
||||
@@ -20,6 +21,7 @@ function Hash(entries) {
|
||||
const entry = entries[index];
|
||||
this.set(entry[0], entry[1]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Add methods to `Hash`.
|
||||
|
||||
@@ -11,7 +11,8 @@ import listCacheSet from './_listCacheSet.js';
|
||||
* @constructor
|
||||
* @param {Array} [entries] The key-value pairs to cache.
|
||||
*/
|
||||
function ListCache(entries) {
|
||||
class ListCache {
|
||||
constructor(entries) {
|
||||
let index = -1;
|
||||
const length = entries == null ? 0 : entries.length;
|
||||
|
||||
@@ -20,6 +21,7 @@ function ListCache(entries) {
|
||||
const entry = entries[index];
|
||||
this.set(entry[0], entry[1]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Add methods to `ListCache`.
|
||||
|
||||
@@ -11,7 +11,8 @@ import mapCacheSet from './_mapCacheSet.js';
|
||||
* @constructor
|
||||
* @param {Array} [entries] The key-value pairs to cache.
|
||||
*/
|
||||
function MapCache(entries) {
|
||||
class MapCache {
|
||||
constructor(entries) {
|
||||
let index = -1;
|
||||
const length = entries == null ? 0 : entries.length;
|
||||
|
||||
@@ -20,6 +21,7 @@ function MapCache(entries) {
|
||||
const entry = entries[index];
|
||||
this.set(entry[0], entry[1]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Add methods to `MapCache`.
|
||||
|
||||
@@ -10,7 +10,8 @@ import setCacheHas from './_setCacheHas.js';
|
||||
* @constructor
|
||||
* @param {Array} [values] The values to cache.
|
||||
*/
|
||||
function SetCache(values) {
|
||||
class SetCache {
|
||||
constructor(values) {
|
||||
let index = -1;
|
||||
const length = values == null ? 0 : values.length;
|
||||
|
||||
@@ -18,6 +19,7 @@ function SetCache(values) {
|
||||
while (++index < length) {
|
||||
this.add(values[index]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Add methods to `SetCache`.
|
||||
|
||||
@@ -12,9 +12,11 @@ import stackSet from './_stackSet.js';
|
||||
* @constructor
|
||||
* @param {Array} [entries] The key-value pairs to cache.
|
||||
*/
|
||||
function Stack(entries) {
|
||||
class Stack {
|
||||
constructor(entries) {
|
||||
const data = this.__data__ = new ListCache(entries);
|
||||
this.size = data.size;
|
||||
}
|
||||
}
|
||||
|
||||
// Add methods to `Stack`.
|
||||
|
||||
Reference in New Issue
Block a user