Internal
Private
#privateLRUCache.OptionsBase.allowStale
LRUCache.OptionsBase.allowStaleOnFetchAbort
LRUCache.OptionsBase.allowStaleOnFetchRejection
LRUCache.OptionsBase.ignoreFetchAbort
LRUCache.OptionsBase.maxEntrySize
LRUCache.OptionsBase.noDeleteOnFetchRejection
LRUCache.OptionsBase.noDeleteOnStaleGet
LRUCache.OptionsBase.noDisposeOnSet
LRUCache.OptionsBase.noUpdateTTL
Optional
sizeLRUCache.OptionsBase.sizeCalculation
LRUCache.OptionsBase.ttl
LRUCache.OptionsBase.ttlAutopurge
LRUCache.OptionsBase.ttlResolution
LRUCache.OptionsBase.updateAgeOnGet
LRUCache.OptionsBase.updateAgeOnHas
The total computed size of items in the cache (read-only)
LRUCache.OptionsBase.dispose (read-only)
LRUCache.OptionsBase.disposeAfter (read-only)
LRUCache.OptionsBase.fetchMethod (read-only)
LRUCache.OptionsBase.max (read-only)
LRUCache.OptionsBase.maxSize (read-only)
The number of items stored in the cache (read-only)
Return a generator yielding [key, value]
pairs,
in order from most recently used to least recently used.
Make an asynchronous cached fetch using the LRUCache.OptionsBase.fetchMethod function.
If multiple fetches for the same key are issued, then they will all be coalesced into a single call to fetchMethod.
Note that this means that handling options such as LRUCache.OptionsBase.allowStaleOnFetchAbort, LRUCache.FetchOptions.signal, and LRUCache.OptionsBase.allowStaleOnFetchRejection will be determined by the FIRST fetch() call for a given key.
This is a known (fixable) shortcoming which will be addresed on when someone complains about it, as the fix would involve added complexity and may not be worth the costs for this edge case.
Find a value for which the supplied fn method returns a truthy value, similar to Array.find(). fn is called as fn(value, key, cache).
Call the supplied function on each item in the cache, in order from most recently used to least recently used. fn is called as fn(value, key, cache). Does not update age or recenty of use. Does not iterate over stale values.
Check if a key is in the cache, without updating the recency of use. Will return false if the item is stale, even though it is technically in the cache.
Will not update item age unless LRUCache.OptionsBase.updateAgeOnHas is set.
Inverse order version of LRUCache.entries
Return a generator yielding [key, value]
pairs,
in order from least recently used to most recently used.
Inverse order version of LRUCache.values
Return a generator yielding the values in the cache, in order from least recently used to most recently used.
Add a value to the cache.
Note: if undefined
is specified as a value, this is an alias for
LRUCache#delete
Static
unsafeInternal
Do not call this method unless you need to inspect the inner workings of the cache. If anything returned by this object is modified in any way, strange breakage may occur.
These fields are private for a reason!
Readonly
head: IndexOptional
options: { Optional
options: { Readonly
tail: IndexGenerated using TypeDoc
an LRUCache for storing child entries.