Class QuickLRU<KeyType, ValueType>
Type Parameters
Index
Constructors
Accessors
Methods
Properties
Accessors
maxSize
- get maxSize(): number
The set max size.
Returns number
size
- get size(): number
The stored item count.
Returns number
Methods
[iterator]
- "[iterator]"(): IterableIterator<[KeyType, ValueType], any, any>
Returns IterableIterator<[KeyType, ValueType], any, any>
clear
delete
entries
- entries(): MapIterator<[KeyType, ValueType]>
Returns an iterable of key, value pairs for every entry in the map.
Returns MapIterator<[KeyType, ValueType]>
entriesAscending
- entriesAscending(): IterableIterator<[KeyType, ValueType], any, any>
Iterable for all entries, starting with the oldest (ascending in recency).
Returns IterableIterator<[KeyType, ValueType], any, any>
entriesDescending
- entriesDescending(): IterableIterator<[KeyType, ValueType], any, any>
Iterable for all entries, starting with the newest (descending in recency).
Returns IterableIterator<[KeyType, ValueType], any, any>
forEach
get
has
keys
- keys(): IterableIterator<KeyType, any, any>
Iterable for all the keys.
Returns IterableIterator<KeyType, any, any>
peek
resize
set
- set(key: KeyType, value: ValueType, options?: { maxAge?: number }): this
Set an item. Returns the instance.
Individual expiration of an item can be specified with the
maxAge
option. If not specified, the globalmaxAge
value will be used in case it is specified in the constructor, otherwise the item will never expire.Returns this
The list instance.
values
- values(): IterableIterator<ValueType, any, any>
Iterable for all the values.
Returns IterableIterator<ValueType, any, any>
Simple "Least Recently Used" (LRU) cache.
The instance is an
Iterable
of[key, value]
pairs so you can use it directly in aforβ¦of
loop.