# multikey-map

> A simple map implementation that supports multiple keys.

Latest version **0.4.0** (published 2024-02-18) · MIT license · 0 weekly downloads

## Install

```sh
npm install multikey-map
pnpm add multikey-map
yarn add multikey-map
bun add multikey-map
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.4.0 |
| Published | 2024-02-18 |
| First published | 2017-08-21 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM |
| Dependencies | 2 |
| Unpacked size | 13.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | vilicvane |
| Maintainers | vilicvane |

## Links

- npm: https://www.npmjs.com/package/multikey-map
- Repository: https://github.com/vilicvane/multikey-map
- Homepage: https://github.com/vilicvane/multikey-map#readme
- Issues: https://github.com/vilicvane/multikey-map/issues
- npm.io page: https://npm.io/package/multikey-map

## Dependencies (2)

- [tslib](https://npm.io/package/tslib.md) ^2.6.2
- [mixed-map](https://npm.io/package/mixed-map.md) ^0.1.0

## Recent versions

- 0.4.0 (latest) — 2024-02-18
- 0.3.0 — 2024-01-25
- 0.2.1 — 2020-07-07
- 0.2.0 — 2017-09-16
- 0.1.2 — 2017-09-16
- 0.1.1 — 2017-08-30
- 0.1.0 — 2017-08-21

## README

[![NPM version](https://img.shields.io/npm/v/multikey-map?color=%23cb3837&style=flat-square)](https://www.npmjs.com/package/multikey-map)
[![Repository package.json version](https://img.shields.io/github/package-json/v/vilicvane/multikey-map?color=%230969da&label=repo&style=flat-square)](./package.json)
[![MIT License](https://img.shields.io/badge/license-MIT-999999?style=flat-square)](./LICENSE)
[![Discord](https://img.shields.io/badge/chat-discord-5662f6?style=flat-square)](https://discord.gg/wEVn2qcf8h)

# Multikey Map

A simple map implementation that supports multiple keys.

> `multikey-map` uses `mixed-map` internally, which is a map implementation that uses both `Map` and `WeakMap` internally.

## Installation

```sh
npm install multikey-map
```

## Usage

```ts
import MultikeyMap from 'multikey-map';

let map = new MultikeyMap<[string, number], string | undefined>();

map.set(['foo', 0], 'a');
map.set(['foo', 1], 'b');

map.get(['foo', 0]); // 'a'
map.get(['foo', 1]); // 'b'
map.get(['foo', 2]); // undefined
map.has(['foo', 2]); // false
map.hasAndGet(['foo', 2]); // [false, undefined]

map.set(['bar', 0], undefined);

map.get(['bar', 0]); // undefined
map.has(['bar', 0]); // true
map.hasAndGet(['bar', 0]); // [true, undefined]
```

## License

MIT License.

---
_Source: https://npm.io/package/multikey-map · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
