invert-kv
v4.2.0
Published
Invert the key/value of an object. Example: `{foo: 'bar'}` → `{bar: 'foo'}`
Downloads
32,860,846
Maintainers
Readme
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', '🌈': '🦄'}