How to use the all function from ramda

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

222
223
224
225
226
227
228
229
230
231
    console.error(`Transaction '${transaction.id}' is already in the blockchain`);
    throw new TransactionAssertionError(`Transaction '${transaction.id}' is already in the blockchain`, transaction);
}

// Verify if all input transactions are unspent in the blockchain
let isInputTransactionsUnspent = R.all(R.equals(false), R.flatten(R.map((txInput) => {
    return R.map(
        R.pipe(
            R.prop('transactions'),
            R.map(R.pipe(
fork icon0
star icon1
watch icon0

+ 3 other calls in file

1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
 * @see R.any, R.none, R.transduce
 * @example
 *
 *      var lessThan2 = R.flip(R.lt)(2);
 *      var lessThan3 = R.flip(R.lt)(3);
 *      R.all(lessThan2)([1, 2]); //=> false
 *      R.all(lessThan3)([1, 2]); //=> true
 */
var all = _curry2(_dispatchable('all', _xall, function all(fn, list) {
    var idx = 0;
fork icon0
star icon0
watch icon0

+ 35 other calls in file

32
33
34
35
36
37
38
39
40
41
fn: or([
  R.equals('@'),
  and([
    R.is(String),
    R.compose(
      R.all(or([
        and([
          testRegex(/^_github(-pages)?-challenge-[a-z0-9-_]+$/i), // Exception for github verification records
          checkRestrictedNames,
        ]),
fork icon0
star icon0
watch icon0

376
377
378
379
380
381
382
383
384
385
386
387
388
389


const ifActionWasBlocked = context => context.blocker != null;


const ifAutoReveal = context => Game.playerHasNInf(context.revealer, 1)(context);


const allConds = (...conds) => (context, event, meta) => R.all(cond => cond(context, event, meta), conds);


const setCurrentAction = assign({
  currentAction: (context, event) => event.action,
  target: (context, event) => typeof event.target == 'number' ? event.target : null
fork icon0
star icon0
watch icon0

+ 6 other calls in file

174
175
176
177
178
179
180
181
182
183
     R.prop('ast'),
     R.prop('body'),
     warnIgnoredTopLevel,
     R.takeWhile(R.both(R.propEq('type', 'VariableDeclaration'),
                        R.pipe(R.prop('declarations'),
                               R.all(isRequireExpr)))),
R.pluck('declarations'),
     R.map(R.head),
     abortIfNotSorted,
     abortIfDifferentRequireVar,
fork icon0
star icon0
watch icon0

376
377
378
379
380
381
382
383
384
*         otherwise.
* @see R.any, R.none, R.transduce
* @example
*
*      const equals3 = R.equals(3);
*      R.all(equals3)([3, 3, 3, 3]); //=> true
*      R.all(equals3)([3, 3, 1, 3]); //=> false
*/

fork icon0
star icon0
watch icon2

+ 7 other calls in file

312
313
314
315
316
317
318
319
320
    const preAggregationForQuery = this.preAggregations.findPreAggregationForQuery();
    if (preAggregationForQuery && preAggregationForQuery.preAggregation.external) {
      return true;
    }
    const preAggregationsDescription = this.preAggregations.preAggregationsDescription();
    return preAggregationsDescription.length && R.all((p) => p.external, preAggregationsDescription);
  }
  return false;
}
fork icon0
star icon0
watch icon0

63
64
65
66
67
68
69
70
71
72
 *
 * @param {string[]} keys1
 * @param {string[]} keys2
 */
const compareKeys = (keys1, keys2) =>
  R.all(
    R.equals(true),
    R.zipWith((x, y) => x === y, keys1, keys2)
  );

fork icon0
star icon0
watch icon0

14
15
16
17
18
19
20
21
22
23
24
  x => parseInt(x.trim(), 10),
  x => x.replace(/[^0-9]/g, '')
)


const leastCommonMultiple = (values) => {
  const allEqual = ar => R.all(
    R.equals(R.head(ar)),
    R.tail(ar)
  )
  
fork icon0
star icon0
watch icon0

58
59
60
61
62
63
64
65
66
67
const maskCheckPositiveFunc = userMask => gt(userMask & mask, 0);
const maskCheckNegativeFunc = userMask => equals(userMask & mask, 0);

const mandatoryMasksResult = ifElse(
    is(Object),
    userMasks => all(maskCheckPositiveFunc, userMasks),
    maskCheckPositiveFunc
)(mandatoryMasks);

const additionalMasksResult = ifElse(
fork icon0
star icon0
watch icon3

+ 3 other calls in file

Other functions in ramda

Sorted by popularity

function icon

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