Permalink
Cannot retrieve contributors at this time
42 lines (40 sloc)
1.27 KB
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
codeql-action/node_modules/lodash/find.js
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var createFind = require('./_createFind'), | |
findIndex = require('./findIndex'); | |
/** | |
* Iterates over elements of `collection`, returning the first element | |
* `predicate` returns truthy for. The predicate is invoked with three | |
* arguments: (value, index|key, collection). | |
* | |
* @static | |
* @memberOf _ | |
* @since 0.1.0 | |
* @category Collection | |
* @param {Array|Object} collection The collection to inspect. | |
* @param {Function} [predicate=_.identity] The function invoked per iteration. | |
* @param {number} [fromIndex=0] The index to search from. | |
* @returns {*} Returns the matched element, else `undefined`. | |
* @example | |
* | |
* var users = [ | |
* { 'user': 'barney', 'age': 36, 'active': true }, | |
* { 'user': 'fred', 'age': 40, 'active': false }, | |
* { 'user': 'pebbles', 'age': 1, 'active': true } | |
* ]; | |
* | |
* _.find(users, function(o) { return o.age < 40; }); | |
* // => object for 'barney' | |
* | |
* // The `_.matches` iteratee shorthand. | |
* _.find(users, { 'age': 1, 'active': true }); | |
* // => object for 'pebbles' | |
* | |
* // The `_.matchesProperty` iteratee shorthand. | |
* _.find(users, ['active', false]); | |
* // => object for 'fred' | |
* | |
* // The `_.property` iteratee shorthand. | |
* _.find(users, 'active'); | |
* // => object for 'barney' | |
*/ | |
var find = createFind(findIndex); | |
module.exports = find; |