How to use the pathSatisfies function from ramda

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

10
11
12
13
14
15
16
17
18
19
20
21
  [R.propIs(Number, 'expiry'), ({ expiry }) => ttlFromExpiry(expiry)],
  [R.propIs(Number, 'timeToLive'), R.prop('timeToLive')],
  [R.T, R.always(DEFAULT_TTL)],
]);


const pathIsString = R.pathSatisfies(R.is(String));


const containsValidRecipients = R.either(
  pathIsString(['recipients', 'to']),
  pathIsString(['recipients', 'condition'])
fork icon117
star icon518
watch icon0

25
26
27
28
29
30
31
32
33
34
35
36
const curry2AndFlip = R.pipe(R.curryN(2), R.flip)


const hash = obj => sha1(JSON.stringify(obj))


function pathsHaveData (list, obj) {
  let pred = R.pathSatisfies(R.anyPass([R.isNil, R.isEmpty]))
  pred = R.anyPass(R.map(pred, list))
  return !pred(obj)
}

fork icon16
star icon5
watch icon0

+ 2 other calls in file

25
26
27
28
29
30
31
32
33
34
//flattens array (because some cities have multiple features)
R.flatten,

//removes 'point' features because theyre stupid
R.filter(
  R.pathSatisfies(
    R.complement(R.equals('Point')),
    ['geometry', 'type'],
  )
),
fork icon1
star icon0
watch icon0

3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
 * @param {*} obj
 * @return {Boolean}
 * @see R.propSatisfies, R.path
 * @example
 *
 *      R.pathSatisfies(y => y > 0, ['x', 'y'], {x: {y: 2}}); //=> true
 */
var pathSatisfies = _curry3(function pathSatisfies(pred, propPath, obj) {
    return propPath.length > 0 && pred(path(propPath, obj));
});
fork icon0
star icon0
watch icon0

+ 17 other calls in file

11124
11125
11126
11127
11128
11129
11130
11131
11132
11133
11134
11135
 * @return {Boolean}
 * @see R.propSatisfies, R.path
 * @example
 *
 *      R.pathSatisfies(y => y > 0, ['x', 'y'], {x: {y: 2}}); //=> true
 *      R.pathSatisfies(R.is(Object), [], {x: {y: 2}}); //=> true
 */




var pathSatisfies =
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)