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

    bi-directional-map

    1.0.0 • Public • Published

    BiDirectionalMap

    Simple implementation of bi directional map (key <=> value) using 2 es6 Maps in typescript.

    Install

    npm install bi-directional-map

    Usage

    const map = new BiDirectionalMap<string, string>({ a: 'apple', b: 'banana' });
     
    map.set('o', 'orange');
    map.deleteKey('b');
    map.deleteValue('apple');
    map.size // 1
    map.hasKey('a') // false
    map.hasValue('banana') // false

    Check tests for more examples.

    Install

    npm i bi-directional-map

    DownloadsWeekly Downloads

    84

    Version

    1.0.0

    License

    MIT

    Last publish

    Collaborators

    • avatar