How to use the toPairs function from ramda

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

158
159
160
161
162
163
164
165
166
167
 * @param {string} tableName
 * @param {object} data - keys should be col. names
 * @return {Promise<Array>}
 */
async function generateParams (tableName, data) {
  const pairs = R.toPairs(data)
  const params = []
  for (const p of pairs) {
    const [column, value] = p
    const cacheData = await sqlService.getCacheEntryForColumn(tableName, column)
fork icon14
star icon12
watch icon11

+ 3 other calls in file

104
105
106
107
108
109
110
111
112
113
            content: content.raw,
          };

        return apiDescription;
      }),
      R.toPairs
    ),
  }),
  R.pick(['apiDescriptions', 'data'])
);
fork icon303
star icon0
watch icon2

16
17
18
19
20
21
22
23
24
25
26
27
      }


      return paths
    },
    [],
    toPairs(parentValue)
  )
)


const edit = curry((transform, paths, config) =>
fork icon2
star icon5
watch icon0

296
297
298
299
300
301
302
303
304
305
306
        return {
          offerID: id,
          hotelID: hotelID
        };
      }), R.always({})), R.prop(category, groupedByCaregory)));
    }, R.toPairs(categoryMap.toObject()));
  });
};


exports.getCategoryWithMinPrice = getCategoryWithMinPrice;
fork icon0
star icon3
watch icon0

+ 41 other calls in file

197
198
199
200
201
202
203
204
205
    'age': 34,
    'salary': 1000000
}

function transform(input) {
    const pairs = _.toPairs(input)
    const filteredPairs = _.filter(_.compose(_.is(Number), _.view(_.lensIndex(1))), pairs)
    return _.fromPairs(filteredPairs)
}
fork icon1
star icon2
watch icon0

+ 3 other calls in file

75
76
77
78
79
80
81
82
83
84
85
86
}
mkQueue(queueSize).addAll(errors_.map((inputElement, inputElementIndex) => async jobIndex => { mapper(output, inputElement, inputElementIndex, doms[jobIndex]) }))


output_ = R.groupBy(R.prop('kanji'), output)
output_ = R.map(xs => R.uniq(xs.map(x => x.transl).flat().filter(x => x)), output_)
output_ = R.toPairs(output_)
output_ = output_.map(([kanji, transl]) => ({ kanji, transl }))
output_ = output_.filter(x => !R.isEmpty(x.transl))


output_ = output_.map(({ kanji, transl }) => ({ kanji, transl: transl.filter(x => x.ch == kanji).filter(R.prop('transl')) })).filter(x => x.transl.length > 0)
fork icon0
star icon4
watch icon2

4469
4470
4471
4472
4473
4474
4475
4476
4477
4478
 * @param {Object} obj The object to extract from
 * @return {Array} An array of key, value arrays from the object's own properties.
 * @see R.fromPairs
 * @example
 *
 *      R.toPairs({a: 1, b: 2, c: 3}); //=> [['a', 1], ['b', 2], ['c', 3]]
 */
var toPairs = _curry1(function toPairs(obj) {
    var pairs = [];
    for (var prop in obj) {
fork icon0
star icon0
watch icon0

+ 17 other calls in file

Other functions in ramda

Sorted by popularity

function icon

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