ndm

n-dimensional-map

Allows to put arrays into maps. Works similarly like ES6 Maps.

Showing:

Popularity

Downloads/wk

4

GitHub Stars

2

Maintenance

Last Commit

2yrs ago

Contributors

0

Package

Dependencies

0

Size (min+gzip)

1.1KB

License

MIT

Type Definitions

Tree-Shakeable

No?

Categories

Readme

Build Status Coverage Status license

Allows to put arrays into maps. Works similarly like ES6 Maps.

Install

npm i n-dimensional-map

Example

const NMap = require('n-dimensional-map');
const map = new NMap();
map.set(1, 'a');
map.set(2, 'b');
map.set([2], 'c');
console.log(map); // NMap { (1) => a, (2) => c }
map.set(1, 2, 3, 'd');
console.log(map.get([1, 2, 3])); // d
map.set(1, 5, 'e');
map.set([1, 5], 'f');
console.log(map.get(1, 5)); // f
console.log(map); // NMap { (1) => a, (1, 2, 3) => d, (1, 5) => f, (2) => c }
map.delete(1, 2, 3);
console.log(map); // NMap { (1) => a, (1, 5) => f, (2) => c }
console.log(map.has(1, 2, 3)); // false
console.log(map.has(1, 5)); // true

License

MIT

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100