index-map-class
TypeScript icon, indicating that this package has built-in type declarations

1.2.0 • Public • Published

index-map

A bi-directional map that allow to create a link between index and object, so that you can retrieve either one if you know the other element.

How to use

const map = new IndexMap();
const index = "myIndex";
const object = {"test": true};

map.set(index, object);

map.has(index); // true
map.has(object); // true

map.get(index).test // true
map.get(object); // "myIndex"

map.delete(index);
// or
map.delete(object);

Readme

Keywords

Package Sidebar

Install

npm i index-map-class

Weekly Downloads

1

Version

1.2.0

License

ISC

Unpacked Size

28.2 kB

Total Files

18

Last publish

Collaborators

  • mcastiello