@matchlighter/common_library
Advanced tools
Comparing version 1.4.2 to 1.4.3
export declare class MultiMap<K, V> { | ||
private _map; | ||
add(key: K, value: V): void; | ||
add_all(key: K, values: Iterable<V>): void; | ||
delete(key: K, value: V): V | undefined; | ||
delete_all(key: K): Set<V> | undefined; | ||
group(key: K): Set<V>; | ||
has(key: K, value: V): boolean; | ||
@@ -7,0 +9,0 @@ grouped(): IterableIterator<[K, Set<V>]>; |
@@ -14,2 +14,7 @@ "use strict"; | ||
} | ||
add_all(key, values) { | ||
for (let v of values) { | ||
this.add(key, v); | ||
} | ||
} | ||
delete(key, value) { | ||
@@ -28,2 +33,5 @@ const set = this._map.get(key); | ||
} | ||
group(key) { | ||
return this._map.get(key) || new Set(); | ||
} | ||
has(key, value) { | ||
@@ -30,0 +38,0 @@ return this._map.get(key)?.has(value); |
export declare class MultiMap<K, V> { | ||
private _map; | ||
add(key: K, value: V): void; | ||
add_all(key: K, values: Iterable<V>): void; | ||
delete(key: K, value: V): V | undefined; | ||
delete_all(key: K): Set<V> | undefined; | ||
group(key: K): Set<V>; | ||
has(key: K, value: V): boolean; | ||
@@ -7,0 +9,0 @@ grouped(): IterableIterator<[K, Set<V>]>; |
@@ -11,2 +11,7 @@ export class MultiMap { | ||
} | ||
add_all(key, values) { | ||
for (let v of values) { | ||
this.add(key, v); | ||
} | ||
} | ||
delete(key, value) { | ||
@@ -25,2 +30,5 @@ const set = this._map.get(key); | ||
} | ||
group(key) { | ||
return this._map.get(key) || new Set(); | ||
} | ||
has(key, value) { | ||
@@ -27,0 +35,0 @@ return this._map.get(key)?.has(value); |
{ | ||
"name": "@matchlighter/common_library", | ||
"version": "1.4.2", | ||
"version": "1.4.3", | ||
"description": "Shared Functions, Helpers, Patterns & Utilities for Apps and Libraries", | ||
@@ -5,0 +5,0 @@ "author": "Matchlighter", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
370573
5823