Defined in: packages/cache/src/cache.ts:243
What CacheEvictionPolicy.chooseVictim may consult while it chooses.
Type Parameters
Section titled “Type Parameters”K
Properties
Section titled “Properties”protectedKey
Section titled “protectedKey”
readonlyprotectedKey:K|undefined
Defined in: packages/cache/src/cache.ts:250
The key being set when the cache already holds it, which must not be
chosen; undefined when the key being set is new. A key that is itself
undefined is indistinguishable here, so a policy over such keys must
not rely on this field to tell the two apart.
isExpired
Section titled “isExpired”
readonlyisExpired: (key) =>boolean
Defined in: packages/cache/src/cache.ts:257
Return true when the cache holds the key and its entry has expired by
the clock reading of the set that asked; false otherwise, and always
without timeToLive. An expired victim is dropped without being
reported, so returning one first spares a live entry.
Parameters
Section titled “Parameters”K
Returns
Section titled “Returns”boolean