Multimap - Map which Allow Multiple Values for the same Key
Install
npm install multimap --save
Usage
If you'd like to use native version when it exists and fallback to polyfill if it doesn't, but without implementing Map on global scope, do:
var Multimap = require('multimap');var m = new Multimap();
If the global es6 Map exists or Multimap.Map is set, Multimap will use the Map as inner store, that means Object can be used as key.
var Multimap = require('multimap');// if harmony is on/* nothing need to do */// or if you are using es6-shimMultimap.Map = ShimMap;var m = new Multimap();var key = {};m.set(key, 'one');
Otherwise, an object will be used, all the keys will be transformed into string.