You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

25 lines
474 B

4 years ago
  1. # invert-kv [![Build Status](https://travis-ci.org/sindresorhus/invert-kv.svg?branch=master)](https://travis-ci.org/sindresorhus/invert-kv)
  2. > Invert the key/value of an object. Example: `{foo: 'bar'}` → `{bar: 'foo'}`
  3. ## Install
  4. ```
  5. $ npm install invert-kv
  6. ```
  7. ## Usage
  8. ```js
  9. const invertKv = require('invert-kv');
  10. invertKv({foo: 'bar', unicorn: 'rainbow'});
  11. //=> {bar: 'foo', rainbow: 'unicorn'}
  12. ```
  13. ## License
  14. MIT © [Sindre Sorhus](https://sindresorhus.com)