UNPKG

vue-app-sdk

Version:
22 lines (21 loc) 556 B
import isArrayLike from "./isArrayLike.js"; function createBaseEach(eachFunc, fromRight) { return function(collection, iteratee) { if (collection == null) { return collection; } if (!isArrayLike(collection)) { return eachFunc(collection, iteratee); } var length = collection.length, index = -1, iterable = Object(collection); while (++index < length) { if (iteratee(iterable[index], index, iterable) === false) { break; } } return collection; }; } export { createBaseEach as default };