@teppeis/multimaps
TypeScript icon, indicating that this package has built-in type declarations

3.0.0 • Public • Published

@teppeis/multimaps

Multi-Map classes for TypeScript and JavaScript

npm version Node.js Version Support TypeScript Version Support build status dependency status monthly downloads License

Install

$ npm i @teppeis/multimaps

Usage

ArrayMultimap

import {ArrayMultimap} from '@teppeis/multimaps';

const map = new ArrayMultimap<string, string>();
map.put('foo', 'a');
map.get('foo'); // ['a']
map.put('foo', 'b');
map.get('foo'); // ['a', 'b']
map.put('foo', 'a');
map.get('foo'); // ['a', 'b', 'a']

SetMultimap

import {SetMultimap} from '@teppeis/multimaps';

const map = new SetMultimap<string, string>();
map.put('foo', 'a');
map.get('foo'); // a `Set` of ['a']
map.put('foo', 'b');
map.get('foo'); // a `Set` of ['a', 'b']
map.put('foo', 'a');
map.get('foo'); // a `Set` of ['a', 'b']

License

MIT License: Teppei Sato <teppeis@gmail.com>

Package Sidebar

Install

npm i @teppeis/multimaps

Weekly Downloads

894,466

Version

3.0.0

License

MIT

Unpacked Size

17.7 kB

Total Files

19

Last publish

Collaborators

  • teppeis