overEvery.js 920 B

1234567891011121314151617181920212223242526272829303132333435
  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. * Following shorthands are possible for providing predicates.
  8. * Pass an `Object` and it will be used as an parameter for `_.matches` to create the predicate.
  9. * Pass an `Array` of parameters for `_.matchesProperty` and the predicate will be created using them.
  10. *
  11. * @static
  12. * @memberOf _
  13. * @since 4.0.0
  14. * @category Util
  15. * @param {...(Function|Function[])} [predicates=[_.identity]]
  16. * The predicates to check.
  17. * @returns {Function} Returns the new function.
  18. * @example
  19. *
  20. * var func = _.overEvery([Boolean, isFinite]);
  21. *
  22. * func('1');
  23. * // => true
  24. *
  25. * func(null);
  26. * // => false
  27. *
  28. * func(NaN);
  29. * // => false
  30. */
  31. var overEvery = createOver(arrayEvery);
  32. module.exports = overEvery;