$ npm install @shaharmor/map-of-sets
import {MapOfSets} from '@shaharmor/map-of-sets';
const mapOfSets = new MapOfSets<string, string>();
mapOfSets.add('key1', 'value1');
mapOfSets.has('key1', 'value1'); // true
mapOfSets.has('key1', 'value2'); // false
mapOfSets.toArray('key1'); // ['value1']
Returns a new MapOfSets
instance, where the type of the maps keys is A
, and the type of the sets values is B
.
Adds the value value
to the Set
with the specific key key
.
Returns true
if value
exists in the Set
with the specific key key
, false
otherwise.
Deletes the value value
from the Set
with the specific key key
.
Returns an array of all values from the Set
with the specific key key
.