mirror of
https://code.forgejo.org/actions/setup-node.git
synced 2025-05-20 13:14:44 +00:00
.
This commit is contained in:
parent
beb1329f9f
commit
2b95e76931
7736 changed files with 1874747 additions and 51184 deletions
32
node_modules/lodash/_createBaseEach.js
generated
vendored
Normal file
32
node_modules/lodash/_createBaseEach.js
generated
vendored
Normal file
|
@ -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;
|
Loading…
Add table
Add a link
Reference in a new issue