How to use the invert function from ramda

Find comprehensive JavaScript ramda.invert code examples handpicked from public code repositorys.

6085
6086
6087
6088
6089
6090
6091
6092
6093
6094
 *      var raceResultsByFirstName = {
 *        first: 'alice',
 *        second: 'jake',
 *        third: 'alice',
 *      };
 *      R.invert(raceResultsByFirstName);
 *      //=> { 'alice': ['first', 'third'], 'jake':['second'] }
 */
var invert = _curry1(function invert(obj) {
    var props = keys(obj);
fork icon0
star icon0
watch icon0

+ 17 other calls in file

8167
8168
8169
8170
8171
8172
8173
8174
8175
8176
* @since v0.9.0
* @category Object
* @sig {s: x} -> {x: s}
* @param {Object} obj The object or array to invert
* @return {Object} out A new object
* @see R.invert
* @example
*
*      const raceResults = {
*        first: 'alice',
fork icon0
star icon0
watch icon2

+ 7 other calls in file

Other functions in ramda

Sorted by popularity

function icon

ramda.clone is the most popular function in ramda (30311 examples)