Repositorio del curso CCOM4030 el semestre B91 del proyecto Artesanías con el Instituto de Cultura

_baseEvery.js 625B

123456789101112131415161718192021
  1. var baseEach = require('./_baseEach');
  2. /**
  3. * The base implementation of `_.every` without support for iteratee shorthands.
  4. *
  5. * @private
  6. * @param {Array|Object} collection The collection to iterate over.
  7. * @param {Function} predicate The function invoked per iteration.
  8. * @returns {boolean} Returns `true` if all elements pass the predicate check,
  9. * else `false`
  10. */
  11. function baseEvery(collection, predicate) {
  12. var result = true;
  13. baseEach(collection, function(value, index, collection) {
  14. result = !!predicate(value, index, collection);
  15. return result;
  16. });
  17. return result;
  18. }
  19. module.exports = baseEvery;