How to use the eqBy function from ramda

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

10
11
12
13
14
15
16
17
18
19
20
)


const makeProcessContexts = (cur_flow_ctx) => {
	const cur_name = R.propOr('_null', 'name')(cur_flow_ctx)
	const max_retain = R.propOr(DEFAULT_MAX_RETAIN, 'retain')(cur_flow_ctx)
	const eqName = R.eqBy(R.prop('name'))
	const getDiffCtxs = R.symmetricDifferenceWith(eqName)
	const dcr = R.evolve({
		[cur_name]: {
			retain: R.dec,
fork icon1
star icon0
watch icon0

9
10
11
12
13
14
15
16
17
18
19
20
const normalizeUsername = R.pipe(
    R.replace(/^@/, ''),
    R.toLower,
);


const areUsernamesEqual = R.eqBy(normalizeUsername);


module.exports = {
    areUsernamesEqual,
    isCommand,
fork icon0
star icon1
watch icon0

34
35
36
37
38
39
40
41
42
43
44
 * @function
 * @param {locale[]} locales
 * @param {string} day
 * @return {string}
 */
const isFirstDay = eqBy(toInt, 1);


/**
 * Ordinalise given day according to the style locales.
 *
fork icon0
star icon0
watch icon0

4790
4791
4792
4793
4794
4795
4796
4797
4798
4799
* @param {Function} pred A predicate used to test whether two items are equal.
* @param {Array} list The array to consider.
* @return {Array} The list of unique items.
* @example
*
*      var strEq = R.eqBy(String);
*      R.uniqWith(strEq)([1, '1', 2, 1]); //=> [1, 2]
*      R.uniqWith(strEq)([{}, {}]);       //=> [{}]
*      R.uniqWith(strEq)([1, '1', 1]);    //=> [1]
*      R.uniqWith(strEq)(['1', 1, 1]);    //=> ['1']
fork icon0
star icon0
watch icon0

+ 53 other calls in file

469
470
471
472
473
474
475
476
477
478
479
480
log(R.differenceWith(cmp, l1)(l2));


log(R.symmetricDifference(list5)(list6));
log(R.symmetricDifference(list6)(list5));


var eqA = R.eqBy(R.prop('a'));
var l3 = [{a: 1}, {a: 2}, {a: 3}, {a: 4}];
var l4 = [{a: 3, b: 1}, {a: 4, b: 2}, {a: 5, b: 3}, {a: 6, b: 4},
  {a: 1, b: 5}, {a: 2, b: 6}, {a: 5, b: 7}, {a: 3, b: 8}];
log(R.symmetricDifferenceWith(eqA, l3, l4));
fork icon0
star icon0
watch icon0

+ 9 other calls in file

13110
13111
13112
13113
13114
13115
13116
13117
13118
13119
* @param {Array} list2 The second list.
* @return {Array} The elements in `list1` or `list2`, but not both.
* @see R.symmetricDifference, R.difference, R.differenceWith
* @example
*
*      const eqA = R.eqBy(R.prop('a'));
*      const l1 = [{a: 1}, {a: 2}, {a: 3}, {a: 4}];
*      const l2 = [{a: 3}, {a: 4}, {a: 5}, {a: 6}];
*      R.symmetricDifferenceWith(eqA, l1, l2); //=> [{a: 1}, {a: 2}, {a: 5}, {a: 6}]
*/
fork icon0
star icon0
watch icon2

+ 11 other calls in file

1
2
3
4
5
6
7
8
9
10
11
12
13
const ra = require("ramda-adjunct")
const fs = require("fs")


const paths = require("./paths")


const eqByString = r.eqBy(String)


const { env } = process
const shouldUseSourceMap = eqByString(env.GENERATE_SOURCEMAP, false)
const isHttps = eqByString(env.HTTPS, true)
fork icon0
star icon0
watch icon0

Other functions in ramda

Sorted by popularity

function icon

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