sindresorhus / invert-kv

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

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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.

About

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

License:MIT License


Languages

Language:JavaScript 74.6%Language:TypeScript 25.4%