summaryrefslogtreecommitdiff
path: root/bin/wiki/ImportarDesdeURL/node_modules/lodash/_createBaseEach.js
diff options
context:
space:
mode:
Diffstat (limited to 'bin/wiki/ImportarDesdeURL/node_modules/lodash/_createBaseEach.js')
-rw-r--r--bin/wiki/ImportarDesdeURL/node_modules/lodash/_createBaseEach.js32
1 files changed, 32 insertions, 0 deletions
diff --git a/bin/wiki/ImportarDesdeURL/node_modules/lodash/_createBaseEach.js b/bin/wiki/ImportarDesdeURL/node_modules/lodash/_createBaseEach.js
new file mode 100644
index 00000000..d24fdd1b
--- /dev/null
+++ b/bin/wiki/ImportarDesdeURL/node_modules/lodash/_createBaseEach.js
@@ -0,0 +1,32 @@
+var isArrayLike = require('./isArrayLike');
+
+/**
+ * Creates a `baseEach` or `baseEachRight` function.
+ *
+ * @private
+ * @param {Function} eachFunc The function to iterate over a collection.
+ * @param {boolean} [fromRight] Specify iterating from right to left.
+ * @returns {Function} Returns the new base function.
+ */
+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 = fromRight ? length : -1,
+ iterable = Object(collection);
+
+ while ((fromRight ? index-- : ++index < length)) {
+ if (iteratee(iterable[index], index, iterable) === false) {
+ break;
+ }
+ }
+ return collection;
+ };
+}
+
+module.exports = createBaseEach;