invert-kv
TypeScript icon, indicating that this package has built-in type declarations

4.2.0 • Public • Published

invert-kv

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

Install

$ npm install invert-kv

Usage

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.

Package Sidebar

Install

npm i invert-kv

Weekly Downloads

5,444,961

Version

4.2.0

License

MIT

Unpacked Size

3.33 kB

Total Files

5

Last publish

Collaborators

  • sindresorhus