# match-map

> Match against the keys in a map

Latest version **1.0.3** (published 2017-10-10) · MIT license · 0 weekly downloads

## Install

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

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.3 |
| Published | 2017-10-10 |
| First published | 2017-10-10 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Aaron Shafovaloff |
| Maintainers | aaronshaf |

## Links

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

## Recent versions

- 1.0.3 (latest) — 2017-10-10
- 1.0.2 — 2017-10-10
- 1.0.1 — 2017-10-10
- 1.0.0 — 2017-10-10

## README

## Installation

```
yarn add match-map
```

Or:

```
npm install match-map --save
```

## Usage

```javascript
import matchMap from 'match-map'
```

Or:

```javascript
const matchMap = require('match-map')
```

Then:

```javascript
const Processing = Symbol()
const Successful = Symbol()
const Error = Symbol()

const state = Successful
const statusMessage = matchMap(state)([
  [Loading, 'Your task is processing'],
  [Successful, 'Your task was successful!'],
  [Error, 'There was an error with your task :(']
])
```

Alternatively:

```javascript
const statusMessage = matchMap(state)(new Map([
  [Loading, 'Your task is processing'],
  [Successful, 'Your task was successful!'],
  [Error, 'There was an error with your task :(']
]))
```

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