xen-orchestra/@vates/multi-key-map
2020-11-09 12:30:35 +01:00
..
index.js feat(@vates): add MultiKeyMap (#5362) 2020-11-09 12:30:35 +01:00
index.spec.js feat(@vates): add MultiKeyMap (#5362) 2020-11-09 12:30:35 +01:00
package.json feat(@vates): add MultiKeyMap (#5362) 2020-11-09 12:30:35 +01:00
README.md feat(@vates): add MultiKeyMap (#5362) 2020-11-09 12:30:35 +01:00
USAGE.md feat(@vates): add MultiKeyMap (#5362) 2020-11-09 12:30:35 +01:00

@vates/multi-key-map

Package Version License PackagePhobia Node compatibility

Create map with values affected to multiple keys

Install

Installation of the npm package:

> npm install --save @vates/multi-key-map

Usage

import { MultiKeyMap } from '@vates/multi-key-map'

const map = new MultiKeyMap()

map.set([], 0)
map.set(['foo'], 1)
map.set(['foo', 'bar'], 2)
map.set(['bar', 'foo'], 3)

map.get([]) // 0
map.get(['foo']) // 1
map.get(['foo', 'bar']) // 2
map.get(['bar', 'foo']) // 3

Contributions

Contributions are very welcomed, either on the documentation or on the code.

You may:

  • report any issue you've encountered;
  • fork and create a pull request.

License

ISC © Vates SAS