SortedMap.clear(), V type
continuous-integration/drone/push Build is failing Details

This commit is contained in:
Martti Malmi 2024-01-04 18:49:05 +02:00
parent c612da125e
commit 046d4d97bd
1 changed files with 6 additions and 5 deletions

View File

@ -1,6 +1,6 @@
type Comparator<K, V> = (a: [K, V], b: [K, V]) => number;
export class SortedMap<K, V> {
export class SortedMap<K, V extends Record<string, any>> {
private map: Map<K, V>;
private sortedKeys: K[];
private compare: Comparator<K, V>;
@ -149,11 +149,12 @@ export class SortedMap<K, V> {
return false;
}
clear(): void {
this.map.clear();
this.sortedKeys = [];
}
get size(): number {
return this.map.size;
}
clear() {
this.map.clear();
}
}