Creates a bounded cache with configurable capacity and entry lifetime.
Maximum number of non-static entries retained
Default time-to-live for entries in milliseconds
Readonly[toStatic Readonly[species]Returns true to identify this instance as a BoundedCache.
Returns the number of entries in the cache after evicting expired entries.
Purges cache entries.
If count is specified, evicts up to count oldest non-static entries.
If omitted, clears all entries, including static entries.
Optionalcount: number
Optional number of entries to evict. If omitted, clears all entries.
Deletes a key from the cache, removing its expiration and static key markers.
The cache key to delete
True if the key was deleted, false if it did not exist
Deletes all cache entries whose keys start with the specified prefix. The prefix comparison is case-insensitive.
The prefix string to match against cache keys
The number of entries deleted
Purges TTL-expired entries.
Retrieves a value from the cache by key. Evaluates TTL expiration via #expires
specifically for the requested key, and updates LRU ordering by deleting and re-inserting
the key in the underlying Map. Leaves the expiration deadline unchanged.
The cache key to retrieve
The cached value, or undefined if not found or expired
Returns a specified element from the Map object.
If no element is associated with the specified key, a new element with the value defaultValue will be inserted into the Map and returned.
The element associated with the specified key, which will be defaultValue if no element previously existed.
Returns a specified element from the Map object.
If no element is associated with the specified key, the result of passing the specified key to the callback function will be inserted into the Map and returned.
The element associated with the specific key, which will be the newly computed value if no element previously existed.
Checks if a key exists in the cache and is not expired. Automatically evicts expired entries on access.
The cache key to check
True if the key exists and is not expired, false otherwise
Returns an iterator of cache keys after evicting expired entries.
Iterator of cache keys
Sets a key-value pair in the cache, enforcing LRU eviction.
If finite-TTL is configured, entries retain their original absolute expiration deadline
unless an explicit ttl override is passed.
If the cache exceeds maxSize, the oldest non-static entry is removed.
This cache instance for chaining
Returns a plain key-value object of all active non-expired cache entries. Filters out non-string keys to prevent lossy key conversions or collisions (e.g. numeric 1 vs string "1").
Returns an iterator of cache values after evicting expired entries.
Iterator of cache values
StaticfromCreates a BoundedCache from an iterable of key-value pairs.
A new BoundedCache instance
Staticgroup
BoundedCache
High-performance Map implementation enforcing maximum capacity (LRU) and TTL eviction. Supports static keys (immortal glossary definitions) and date-salt staleness purging.