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'])
117
518
0
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) }
16
5
0
+ 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'], ) ),
1
0
0
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)); });
0
0
0
+ 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 =
0
0
2
+ 7 other calls in file
ramda.clone is the most popular function in ramda (30311 examples)