Lodash _.find() 函数的源代码在哪里?

问题描述 投票:0回答:0

这是 Lodash 的查找功能

例子

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

这是 Lodash Github 仓库

我试图在回购协议中找到

_.find()
功能,但我没有看到它。

在哪里?

javascript github lodash open-source
© www.soinside.com 2019 - 2024. All rights reserved.