LimitedCollection

export class LimitedCollection<Key, Value> extends Collection<Key, Value>
export class LimitedCollection<Key, Value> extends Collection<Key, Value>
A Collection which holds a max amount of entries.

Extends

Collection<Key, Value>
NameConstraintsOptionalDefaultDescription
KeyNoNone
ValueNoNone
constructor(options?, iterable?)
NameTypeOptionalDescription
optionsLimitedCollectionOptions<Key, Value>YesNone
iterableIterable<readonly [Key, Value]>YesNone
keepOverLimit:((value: Value, key: Key, collection: this) => boolean) | null
A function called to check if an entry should be kept when the Collection is at max size.
maxSize:number
The max size of the Collection.