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:
25
react-app/node_modules/lodash/internal/baseFind.js
generated
vendored
Normal file
25
react-app/node_modules/lodash/internal/baseFind.js
generated
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
/**
|
||||
* The base implementation of `_.find`, `_.findLast`, `_.findKey`, and `_.findLastKey`,
|
||||
* without support for callback shorthands and `this` binding, which iterates
|
||||
* over `collection` using the provided `eachFunc`.
|
||||
*
|
||||
* @private
|
||||
* @param {Array|Object|string} collection The collection to search.
|
||||
* @param {Function} predicate The function invoked per iteration.
|
||||
* @param {Function} eachFunc The function to iterate over `collection`.
|
||||
* @param {boolean} [retKey] Specify returning the key of the found element
|
||||
* instead of the element itself.
|
||||
* @returns {*} Returns the found element or its key, else `undefined`.
|
||||
*/
|
||||
function baseFind(collection, predicate, eachFunc, retKey) {
|
||||
var result;
|
||||
eachFunc(collection, function(value, key, collection) {
|
||||
if (predicate(value, key, collection)) {
|
||||
result = retKey ? key : value;
|
||||
return false;
|
||||
}
|
||||
});
|
||||
return result;
|
||||
}
|
||||
|
||||
module.exports = baseFind;
|
Reference in New Issue
Block a user