import { default } from "https://deno.land/x/lru_cache@6.0.0-deno.4/mod.ts";
Properties
Return total quantity of objects currently in cache. Note,
that stale
(see options) items are returned as part of this item count.
Methods
Return an array of the cache entries ready for serialization and usage with destinationCache.load(arr)
.
Just like Array.prototype.forEach
. Iterates over all the keys in the cache,
in order of recent-ness. (Ie, more recently used items are iterated over first.)
Will update the "recently used"-ness of the key. They do what you think.
maxAge
is optional and overrides the cache maxAge
option if provided.
If the key is not found, will return undefined
.
Loads another cache entries array, obtained with sourceCache.dump()
,
into the cache. The destination cache is reset before loading new entries
Returns the key value (or undefined
if not found) without updating
the "recently used"-ness of the key.
(If you find yourself using this a lot, you might be using the wrong sort of data structure, but there are some use cases where it's handy.)
The same as cache.forEach(...)
but items are iterated over in reverse order.
(ie, less recently used items are iterated over first.)