Napoleonic Political Magnificence
    Have ideas to improve npm?Join in the discussion! »

    es6-two-way-map

    1.0.9 • Public • Published

    es6-two-way-map

    JavaScript bidirectional map implementation. With BiMap you can get value by key, and also key by value

    Install

    $ npm i -S es6-two-way-map

    Usage

    Import

    import { BiMap } from 'es6-two-way-map';
    const { BiMap } = require('es6-two-way-map/src');
    

    Basic

    const a = new BiMap([['a',1], ['a2', 2], ['a3', 3]]);
    //Map { 'a' => 1, 1 => 'a', 'a2' => 2, 2 => 'a2', 'a3' => 2, 3 => 'a3' }
    

    Side Effect

    It will be fixed as soon as possible

    const a = new BiMap([[1, 'a1'],['a3', 1]]);
    //Map { 1 => 'a3', 'a1' => 1, 'a3' => 1 }
    

    Install

    npm i es6-two-way-map

    DownloadsWeekly Downloads

    12

    Version

    1.0.9

    License

    MIT

    Unpacked Size

    3.47 kB

    Total Files

    7

    Last publish

    Collaborators

    • avatar