How to use the where function from ramda

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

6789
6790
6791
6792
6793
6794
6795
6796
6797
6798
* @category Object
* @sig {String: *} -> {String: *} -> Boolean
* @param {Object} spec
* @param {Object} testObj
* @return {Boolean}
* @see R.where
* @example
*
*      // pred :: Object -> Boolean
*      var pred = R.whereEq({a: 1, b: 2});
fork icon0
star icon0
watch icon0

+ 17 other calls in file

55
56
57
58
59
60
61
62
63
64
owner: {
  reason: '`owner` needs valid username and email properties',
  fn: and([
    R.is(Object),
    R.complement(R.isEmpty),
    R.where({
      username: and([R.is(String), withLengthGte(1)]),
      email: R.is(String),
    }),
  ]),
fork icon0
star icon0
watch icon0

591
592
593
594
595
596
597
598
599
600
601
602
log(pred({a: 1, b: 2}));
log(pred({a: 1, b: 2, c: 3}));
log(pred({a: 1, b: 1}));




var pred = R.where({
  a: R.equals('foo'),
  b: R.complement(R.equals('bar')),
  x: R.gt(R.__, 10),
  y: R.lt(R.__, 20)
fork icon0
star icon0
watch icon0

+ 9 other calls in file

14867
14868
14869
14870
14871
14872
14873
14874
14875
14876
* @return {Boolean}
* @see R.propSatisfies, R.whereEq
* @example
*
*      // pred :: Object -> Boolean
*      const pred = R.where({
*        a: R.equals('foo'),
*        b: R.complement(R.equals('bar')),
*        x: R.gt(R.__, 10),
*        y: R.lt(R.__, 20)
fork icon0
star icon0
watch icon2

+ 3 other calls in file

41
42
43
44
45
46
47
48
49
50

var tagKey         = options.tagKey;
var styleTagKey    = options.styleTagKey;
var childrenKey    = options.childrenKey;
var hasChildrenKey = R.has(childrenKey);
var isStyleNode    = R.where(R.objOf(tagKey, R.equals(styleTagKey)));

return function prefixStyleClassId (value) {
    var path        = this.path;
    var isStyle     = isStyleNode(value);
fork icon0
star icon0
watch icon0

17
18
19
20
21
22
23
24
25
26
  name: validateStringOrNil,
  category: validateCategoryOrNil,
  group: validateStringOrNil
};

const isValidData = R.where(dataValidationSpec);

const getNextId = (items) => {
  if (R.isEmpty(items)) {
    return 1;
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)