1.0.2 • Published 10 months ago

@esfx/collections-multimap v1.0.2

Weekly downloads
1
License
Apache-2.0
Repository
github
Last release
10 months ago

@esfx/collections-multimap

Provides the MultiMap class, a collection class that maps a single key to multiple values.

Overview

Installation

npm i @esfx/collections-multimap

Usage

import { MultiMap } from "@esfx/collections-multimap";

const multi = new MultiMap();
multi.add("a", 1);
multi.add("a", 2);
multi.add("b", 3);
multi.size; // 3
[...multi.get("a")]; // [1, 2]
[...multi.get("b")]; // [3]

API

You can read more about the API here.