https://github.com/oelin/invert-map
Invert JavaScript maps 🔄.
https://github.com/oelin/invert-map
invert javascript map nodejs
Last synced: 25 days ago
JSON representation
Invert JavaScript maps 🔄.
- Host: GitHub
- URL: https://github.com/oelin/invert-map
- Owner: oelin
- License: isc
- Created: 2023-01-21T12:38:09.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-01-21T12:44:39.000Z (over 3 years ago)
- Last Synced: 2023-02-27T20:20:36.044Z (over 3 years ago)
- Topics: invert, javascript, map, nodejs
- Language: JavaScript
- Homepage:
- Size: 6.84 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# invert-map
Invert JavaScript maps 🔄.
## API
Create a map.
```js
> const map = new Map();
> map.set('foo', 'bar')
> map.set('hello', 'world')
```
Invert it.
```js
> const invert = require('invert-map')
> invert(map)
Map { bar => foo, world => hello }
```