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/createFind.js
generated
vendored
Normal file
25
react-app/node_modules/lodash/internal/createFind.js
generated
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
var baseCallback = require('./baseCallback'),
|
||||
baseFind = require('./baseFind'),
|
||||
baseFindIndex = require('./baseFindIndex'),
|
||||
isArray = require('../lang/isArray');
|
||||
|
||||
/**
|
||||
* Creates a `_.find` or `_.findLast` 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 find function.
|
||||
*/
|
||||
function createFind(eachFunc, fromRight) {
|
||||
return function(collection, predicate, thisArg) {
|
||||
predicate = baseCallback(predicate, thisArg, 3);
|
||||
if (isArray(collection)) {
|
||||
var index = baseFindIndex(collection, predicate, fromRight);
|
||||
return index > -1 ? collection[index] : undefined;
|
||||
}
|
||||
return baseFind(collection, predicate, eachFunc);
|
||||
};
|
||||
}
|
||||
|
||||
module.exports = createFind;
|
Reference in New Issue
Block a user