How to use the propEq function from ramda

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

23
24
25
26
27
28
29
30
31
32
33
  return table
}


// Checks for enums
const ownerTypeValid = anyPass([
  propEq('ownerType', 'user'),
  propEq('ownerType', 'team'),
  propEq('ownerType', 'org')
])

fork icon0
star icon1
watch icon0

+ 9 other calls in file

1
2
3
4
5
6
7
8
9
10
11


// :: String -> Array -> Object
const findById = R.converge(R.find, [
    R.pipe(
        R.nthArg(0),
        R.propEq('id')
    ),
    R.nthArg(1)
])

fork icon0
star icon0
watch icon0

6478
6479
6480
6481
6482
6483
6484
6485
6486
6487
 *      var abby = {name: 'Abby', age: 7, hair: 'blond'};
 *      var fred = {name: 'Fred', age: 12, hair: 'brown'};
 *      var rusty = {name: 'Rusty', age: 10, hair: 'brown'};
 *      var alois = {name: 'Alois', age: 15, disposition: 'surly'};
 *      var kids = [abby, fred, rusty, alois];
 *      var hasBrownHair = R.propEq('hair', 'brown');
 *      R.filter(hasBrownHair, kids); //=> [fred, rusty]
 */
var propEq = _curry3(function propEq(name, val, obj) {
    return equals(val, obj[name]);
fork icon0
star icon0
watch icon0

+ 53 other calls in file

125
126
127
128
129
130
131
132
133

shuffleDeck_s: () => liftDeck(State.get()).chain(
  deck => liftRand(Rand.shuffle(deck))).chain(
    deck => liftDeck(State.put(deck))),

turnEq: R.propEq('whoseTurn'),
actionEq: R.propEq('currentAction'),

applyRevealAction: context => R.assoc('revealer', context.target, context),
fork icon0
star icon0
watch icon0

+ 34 other calls in file

580
581
582
583
584
585
586
587
588
589
590
var abby = {name: 'Abby', age: 7, hair: 'blond'};
var fred = {name: 'Fred', age: 12, hair: 'brown'};
var rusty = {name: 'Rusty', age: 10, hair: 'brown'};
var alois = {name: 'Alois', age: 15, hair: 'surly'};
var kids = [abby, fred, rusty, alois];
var hasBrownHair = R.propEq('hair', 'brown');
log(R.filter(hasBrownHair)(kids));


var pred = R.whereEq({a: 1, b: 2});

fork icon0
star icon0
watch icon0

+ 9 other calls in file

37
38
39
40
41
42
43
44
45
46
47
48
  intArrayHash);
const stringArrayHash = arrayHash(stringHash);
const deckHash = R.pipe(R.path(['context', 'deck']), stringArrayHash);


const turnEq = R.propEq('whoseTurn');
const actionEq = R.propEq('currentAction');


const sampleGame = (seed, context) => {
  const def = new GameDef();
  const deck = def.makeDeck();
fork icon0
star icon0
watch icon0

+ 15 other calls in file

81
82
83
84
85
86
87
88
89
90
91
92
93
  R.addIndex (R.map) (R.pair),
  R.filter(pair => !Player.isDead(pair[0]) && pair[1] != game.whoseTurn),
  R.map(R.nth(1))
) (game);


Game.turnEq = R.propEq('whoseTurn');


Object.freeze(Game);


///// Action
fork icon0
star icon0
watch icon0

+ 19 other calls in file

43
44
45
46
47
48
49
50
51
52
53
54
  const options = {autoPaginate: false};
  return client.createTransferConfig(request, options)
}


// const extractTransferConfigName = (configDisplayName) => (configList) => {
//   const extractTransferDisplayName = R.propEq('displayName', configDisplayName)
//   return R.prop('name', R.find(extractTransferDisplayName, configList))
// }


const extractTransferConfig = (configNameList) => (configObj) => {
fork icon0
star icon0
watch icon0

438
439
440
441
442
443
444
445
446
447
* @param {Array} predicates An array of predicates to check
* @return {Function} The combined predicate
* @see R.anyPass
* @example
*
*      const isQueen = R.propEq('rank', 'Q');
*      const isSpade = R.propEq('suit', '♠︎');
*      const isQueenOfSpades = R.allPass([isQueen, isSpade]);
*
*      isQueenOfSpades({rank: 'Q', suit: '♣︎'}); //=> false
fork icon0
star icon0
watch icon2

+ 19 other calls in file

155
156
157
158
159
160
161
162
163
164
  };
} else {
  const newPath = R.drop(1, path);
  const newTarget = R.head(newPath);
  const newStructure = R.find(
    R.propEq('moduleName', newTarget),
    structure.subfolders
  );
  setInstructions(newStructure.aum_instructions);
  return getForm(newPath, newStructure);
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)