invert-object

0.0.0 • Public • Published

invert-object

Usage

Invert an object so that keys becomes values and values become keys. Duplicate values in input is allowed by puttin all keys in arrays.

Example

 
var assert = require('assert')
 
  , invertObject = require('invert-object')
 
  , inverted = invertObject({foo: '1', bar: 1})
 
assert.deepEqual(inverted, {1: ['foo', 'bar']})
 

Readme

Keywords

none

Package Sidebar

Install

npm i invert-object

Weekly Downloads

0

Version

0.0.0

License

none

Last publish

Collaborators

  • kesla