import { type Cache } from "https://deno.land/x/velo@1.0.0/src/cache/cache.ts";
Maps keys to values. Entries are manually added via set and either evicted by the caching policy or manually removed via remove.
Type Parameters
Properties
Returns all keys stored in the cache. Ordering depends on the policy that is used; do not expect keys to be ordered in any particular way.
Returns all values stored in the cache. Ordering depends on the policy that is used; do not expect keys to be ordered in any particular way.
Methods
Maps a key
to a value
. If the key already exists in the
cache, the value will be replaced by the new value.
Returns the value of an entry with given key
. If the key is not cached,
undefined
is returned. This operation does not trigger policy actions and
will not affect cache statistics.
Returns the value associated with a key and removes the key from the cache. Equivalent of calling:
cache.get(key);
cache.remove(key);