invert-kv

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


Keywords
object, key, value, invert, keys, values
License
MIT
Install
npm install invert-kv@3.0.0

Documentation

invert-kv Build Status

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

Install

$ npm install invert-kv

Usage

const invertKeyValue = require('invert-kv');

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

License

MIT © Sindre Sorhus