1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- var arrayEvery = require('./_arrayEvery'),
- baseEvery = require('./_baseEvery'),
- baseIteratee = require('./_baseIteratee'),
- isArray = require('./isArray'),
- isIterateeCall = require('./_isIterateeCall');
- function every(collection, predicate, guard) {
- var func = isArray(collection) ? arrayEvery : baseEvery;
- if (guard && isIterateeCall(collection, predicate, guard)) {
- predicate = undefined;
- }
- return func(collection, baseIteratee(predicate, 3));
- }
- module.exports = every;
|