Skip to content

Instantly share code, notes, and snippets.

// Harry Kruger
// License: MIT
class LimitedSet extends Set {
constructor(limit = 0, maxAge = 0, sweepInterval = 1000 * 60, init) {
super(init);
this.limit = limit;
this.maxAge = maxAge;
this._sweepInterval = sweepInterval;