Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/sindresorhus/invert-kv

Invert the key/value of an object. Example: {foo: 'bar'} → {bar: 'foo'}
https://github.com/sindresorhus/invert-kv

Last synced: about 1 month ago
JSON representation

Invert the key/value of an object. Example: {foo: 'bar'} → {bar: 'foo'}

Awesome Lists containing this project

README

        

# invert-kv

> Invert the key/value of an object. Example: `{foo: 'bar'}` → `{bar: 'foo'}`

## Install

```
$ npm install invert-kv
```

## Usage

```js
import invertKeyValue from 'invert-kv';

invertKeyValue({foo: 'bar', '🦄': '🌈'});
//=> {bar: 'foo', '🌈': '🦄'}
```

---



Get professional support for this package with a Tidelift subscription




Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies.