overSome.js 647 B

123456789101112131415161718192021222324252627282930
  1. var arraySome = require('./_arraySome'),
  2. createOver = require('./_createOver');
  3. /**
  4. * Creates a function that checks if **any** 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 = _.overSome([Boolean, isFinite]);
  17. *
  18. * func('1');
  19. * // => true
  20. *
  21. * func(null);
  22. * // => true
  23. *
  24. * func(NaN);
  25. * // => false
  26. */
  27. var overSome = createOver(arraySome);
  28. module.exports = overSome;