Share your code. Components are building blocks, you are the architect.

utils/invert
v1.1.0
1.1.0
1.0.0
MIT
PUBLIC
3
Build: fail
BuildFail
Build Status: fail
Same as [`R.invertObj`](#invertObj), however this accounts for objects with

Please configure Bit as a scoped registry to install components with NPM.Learn more

npm config set '@bit:registry' https://node.bitsrc.io
Use utils/invert in your project
npm i @bit/bit.ramda.utils.invert
Copied

invert (obj:Object) : Object

Same as R.invertObj, however this accounts for objects with duplicate values by putting the values into an array.

Example

var raceResultsByFirstName = {
       first: 'alice',
       second: 'jake',
       third: 'alice',
     };
     R.invert(raceResultsByFirstName);
     //=> { 'alice': ['first', 'third'], 'jake':['second'] }

Argument

obj: Object

The object or array to invert

Returns

Object

out A new object with keys in an array.