mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
# add dist
This commit is contained in:
45
ng2-components/ng2-alfresco-documentslist/dist/node_modules/lodash/findLastIndex.js
generated
vendored
Normal file
45
ng2-components/ng2-alfresco-documentslist/dist/node_modules/lodash/findLastIndex.js
generated
vendored
Normal file
@@ -0,0 +1,45 @@
|
||||
var baseFindIndex = require('./_baseFindIndex'),
|
||||
baseIteratee = require('./_baseIteratee');
|
||||
|
||||
/**
|
||||
* This method is like `_.findIndex` except that it iterates over elements
|
||||
* of `collection` from right to left.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @since 2.0.0
|
||||
* @category Array
|
||||
* @param {Array} array The array to search.
|
||||
* @param {Array|Function|Object|string} [predicate=_.identity]
|
||||
* The function invoked per iteration.
|
||||
* @returns {number} Returns the index of the found element, else `-1`.
|
||||
* @example
|
||||
*
|
||||
* var users = [
|
||||
* { 'user': 'barney', 'active': true },
|
||||
* { 'user': 'fred', 'active': false },
|
||||
* { 'user': 'pebbles', 'active': false }
|
||||
* ];
|
||||
*
|
||||
* _.findLastIndex(users, function(o) { return o.user == 'pebbles'; });
|
||||
* // => 2
|
||||
*
|
||||
* // The `_.matches` iteratee shorthand.
|
||||
* _.findLastIndex(users, { 'user': 'barney', 'active': true });
|
||||
* // => 0
|
||||
*
|
||||
* // The `_.matchesProperty` iteratee shorthand.
|
||||
* _.findLastIndex(users, ['active', false]);
|
||||
* // => 2
|
||||
*
|
||||
* // The `_.property` iteratee shorthand.
|
||||
* _.findLastIndex(users, 'active');
|
||||
* // => 0
|
||||
*/
|
||||
function findLastIndex(array, predicate) {
|
||||
return (array && array.length)
|
||||
? baseFindIndex(array, baseIteratee(predicate, 3), true)
|
||||
: -1;
|
||||
}
|
||||
|
||||
module.exports = findLastIndex;
|
Reference in New Issue
Block a user