Skip to main content

Function: setBoundedCacheValue()

setBoundedCacheValue<Key, Value>(options: Readonly<{ cache: Map<Key, Value>; key: Key; maxEntries: number; value: Value; }>): void

Defined in: _internal/bounded-cache.ts:62

Insert or update a cache entry and evict least-recently-used entries beyond the configured max size.

Type Parametersโ€‹

Keyโ€‹

Key

Valueโ€‹

Value

Parametersโ€‹

optionsโ€‹

Readonly<{ cache: Map<Key, Value>; key: Key; maxEntries: number; value: Value; }>

Bounded-cache insertion options.

  • cache: Mutable cache map.
  • key: Entry key.
  • maxEntries: Maximum number of cache entries to retain.
  • value: Entry value.

Returnsโ€‹

void