export interface LifetimeFilterOptions<Key, Value>
Options for generating a filter function based on lifetime
Type Parameters
Key
Value
optional(value: Value, key: Key, collection: LimitedCollection<Key, Value>) => boolean excludeFromSweep? :
A function that takes an entry, key, and the collection and returns a boolean, true
when the entry should not be checked for sweepability. (default: () = false)
optional(value: Value, key: Key, collection: LimitedCollection<Key, Value>) => number getComparisonTimestamp? :
A function that takes an entry, key, and the collection and returns a timestamp to compare against in order to determine the lifetime of the entry. (default: e = e?.createdTimestamp)
optionalnumber lifetime? :
How long, in seconds, an entry should stay in the collection before it is considered sweepable. (default: 14400)