overEvery.js 654 B

123456789101112131415161718192021222324252627282930
  1. var arrayEvery = require('./_arrayEvery'),
  2. createOver = require('./_createOver');
  3. /**
  4. * Creates a function that checks if **all** of the `predicates` return
  5. * truthy when invoked with the arguments it receives.
  6. *
  7. * @static
  8. * @memberOf _
  9. * @since 4.0.0
  10. * @category Util
  11. * @param {...(Function|Function[])} [predicates=[_.identity]]
  12. * The predicates to check.
  13. * @returns {Function} Returns the new function.
  14. * @example
  15. *
  16. * var func = _.overEvery([Boolean, isFinite]);
  17. *
  18. * func('1');
  19. * // => true
  20. *
  21. * func(null);
  22. * // => false
  23. *
  24. * func(NaN);
  25. * // => false
  26. */
  27. var overEvery = createOver(arrayEvery);
  28. module.exports = overEvery;