mirror of
https://github.com/discordeno/discordeno.git
synced 2026-09-17 08:47:22 +00:00
Add forceSet option for collection (#2232)
* Add forceSet option for collection * Use .forceSet approach instead oveer-complicated set options Co-authored-by: meister03 <root@_HOSTNAME_>
This commit is contained in:
@@ -8,6 +8,7 @@ export class Collection<K, V> extends Map<K, V> {
|
||||
super(entries ?? []);
|
||||
|
||||
this.maxSize = options?.maxSize;
|
||||
|
||||
if (!options?.sweeper) return;
|
||||
|
||||
this.startSweeper(options.sweeper);
|
||||
@@ -54,6 +55,10 @@ export class Collection<K, V> extends Map<K, V> {
|
||||
return super.set(key, value);
|
||||
}
|
||||
|
||||
forceSet(key: K, value: V) {
|
||||
return super.set(key, value);
|
||||
}
|
||||
|
||||
array() {
|
||||
return [...this.values()];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user