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

utils/invert-obj
v1.1.0
1.1.0
1.0.0
MIT
PUBLIC
3
Build: fail
BuildFail
Build Status: fail
Returns a new object with the keys of the given object as values, and the

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-obj in your project
npm i @bit/bit.ramda.utils.invert-obj
Copied

invertObj (obj:Object) : Object

Returns a new object with the keys of the given object as values, and the values of the given object, which are coerced to strings, as keys. Note that the last key found is preferred when handling the same value.

Example

var raceResults = {
       first: 'alice',
       second: 'jake'
     };
     R.invertObj(raceResults);
     //=> { 'alice': 'first', 'jake':'second' }

     // Alternatively:
     var raceResults = ['alice', 'jake'];
     R.invertObj(raceResults);
     //=> { 'alice': '0', 'jake':'1' }

Argument

obj: Object

The object or array to invert

Returns

Object

out A new object