Validate limits and policy callbacks; allocate entry storage lazily on admission.
Number of currently retained entries.
Return a new frozen snapshot of usage and limits.
Total estimated retained bytes, including keys and entry overhead.
Remove all entries and release the backing cache.
Remove an entry and its accounted bytes; return whether it existed.
Read a value and mark an existing entry most recently used.
Test membership without refreshing recency.
Iterate keys from least to most recently used without refreshing recency.
Read a value without refreshing recency; missing keys return undefined.
Chainable insertion; use trySet to observe admission or rejection.
Rejection or callback failure does not replace, evict, or refresh existing entries.
StaticcreateOptional owner storage: returns undefined when either validated limit is zero.
String-keyed LRU with estimated byte accounting, not a heap-memory guarantee. Cost = entry overhead + two bytes per UTF-16 key code unit + measured payload. Values remain caller-owned unless detach is supplied; do not mutate retained values in a way that changes their measured size. Callbacks are synchronous.