mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-31 17:38:48 +00:00
react app
This commit is contained in:
31
react-app/node_modules/lodash/internal/createBaseEach.js
generated
vendored
Normal file
31
react-app/node_modules/lodash/internal/createBaseEach.js
generated
vendored
Normal file
@@ -0,0 +1,31 @@
|
||||
var getLength = require('./getLength'),
|
||||
isLength = require('./isLength'),
|
||||
toObject = require('./toObject');
|
||||
|
||||
/**
|
||||
* 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) {
|
||||
var length = collection ? getLength(collection) : 0;
|
||||
if (!isLength(length)) {
|
||||
return eachFunc(collection, iteratee);
|
||||
}
|
||||
var index = fromRight ? length : -1,
|
||||
iterable = toObject(collection);
|
||||
|
||||
while ((fromRight ? index-- : ++index < length)) {
|
||||
if (iteratee(iterable[index], index, iterable) === false) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
return collection;
|
||||
};
|
||||
}
|
||||
|
||||
module.exports = createBaseEach;
|
Reference in New Issue
Block a user