MCPcopy Create free account
hub / github.com/denoland/std / MemoizationCache

Interface MemoizationCache

cache/memoize.ts:11–20  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9 * @experimental **UNSTABLE**: New API, yet to be vetted.
10 */
11export interface MemoizationCache<K, V> {
12 /** Checks whether a value for the given key exists in the cache. */
13 has(key: K): boolean;
14 /** Returns the cached value associated with the given key, if present. */
15 get(key: K): V | undefined;
16 /** Stores a value in the cache under the given key. */
17 set(key: K, val: V): unknown;
18 /** Removes the value associated with the given key from the cache. */
19 delete(key: K): unknown;
20}
21
22/**
23 * The result of a memoized function, as stored in its cache.

Callers 32

getMethod · 0.65
peekMethod · 0.65
lru_cache_test.tsFile · 0.65
assertEntriesFunction · 0.65
ttl_cache_test.tsFile · 0.65
hasMethod · 0.65
getMethod · 0.65
setMethod · 0.65
getMethod · 0.65
peekMethod · 0.65
deleteMethod · 0.65

Implementers 1

LruCachecache/lru_cache.ts

Calls

no outgoing calls

Tested by

no test coverage detected