Class: CachedMap<K, V>
Defined in: src/classes/CachedMap.ts:3
Type Parameters
K
K extends object
V
V extends object
Implements
Map<K,V>
Constructors
Constructor
> new CachedMap<K, V>(options): CachedMap<K, V>
Defined in: src/classes/CachedMap.ts:6
Parameters
options
cacheSize
number
Returns
CachedMap<K, V>
Properties
cache
> readonly cache: LRUCache<K, V>
Defined in: src/classes/CachedMap.ts:4
map
> readonly map: Map<K, V>
Defined in: src/classes/CachedMap.ts:5
Accessors
[iterator]
Get Signature
> get [iterator](): () => MapIterator<[K, V]>
Defined in: src/classes/CachedMap.ts:12
Returns
> (): MapIterator<[K, V]>
Returns an iterable of entries in the map.
Returns
MapIterator<[K, V]>
Implementation of
Map.[iterator]
[toStringTag]
Get Signature
> get [toStringTag](): string
Defined in: src/classes/CachedMap.ts:15
Returns
string
Implementation of
Map.[toStringTag]
forEach
Get Signature
> get forEach(): (callbackfn, thisArg?) => void
Defined in: src/classes/CachedMap.ts:29
Executes a provided function once per each key/value pair in the Map, in insertion order.
Returns
> (callbackfn, thisArg?): void
Executes a provided function once per each key/value pair in the Map, in insertion order.
Parameters
callbackfn
(value, key, map) => void
thisArg?
any
Returns
void
Implementation of
Map.forEach
size
Get Signature
> get size(): number
Defined in: src/classes/CachedMap.ts:47
Returns
number
the number of elements in the Map.
Implementation of
Map.size
Methods
clear()
> clear(): void
Defined in: src/classes/CachedMap.ts:18
Returns
void
Implementation of
Map.clear
delete()
> delete(key): boolean
Defined in: src/classes/CachedMap.ts:22
Parameters
key
K
Returns
boolean
true if an element in the Map existed and has been removed, or false if the element does not exist.
Implementation of
Map.delete
entries()
> entries(): MapIterator<[K, V]>
Defined in: src/classes/CachedMap.ts:50
Returns an iterable of key, value pairs for every entry in the map.
Returns
MapIterator<[K, V]>
Implementation of
Map.entries
get()
> get(key): V | undefined
Defined in: src/classes/CachedMap.ts:32
Returns a specified element from the Map object. If the value that is associated to the provided key is an object, then you will get a reference to that object and any change made to that object will effectively modify it inside the Map.
Parameters
key
K
Returns
V | undefined
Returns the element associated with the specified key. If no element is associated with the specified key, undefined is returned.
Implementation of
Map.get
has()
> has(key): boolean
Defined in: src/classes/CachedMap.ts:39
Parameters
key
K
Returns
boolean
boolean indicating whether an element with the specified key exists or not.
Implementation of
Map.has
keys()
> keys(): MapIterator<K>
Defined in: src/classes/CachedMap.ts:53
Returns an iterable of keys in the map
Returns
MapIterator<K>
Implementation of
Map.keys
set()
> set(key, value): this
Defined in: src/classes/CachedMap.ts:42
Adds a new element with a specified key and value to the Map. If an element with the same key already exists, the element will be updated.
Parameters
key
K
value
V
Returns
this
Implementation of
Map.set
values()
> values(): MapIterator<V>
Defined in: src/classes/CachedMap.ts:56
Returns an iterable of values in the map
Returns
MapIterator<V>
Implementation of
Map.values