mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-11 03:17:49 +00:00
Remove _.isObject use from _.findWhere and _.where.
This commit is contained in:
@@ -3994,7 +3994,7 @@
|
|||||||
* // => { 'name': 'fred', 'age': 40, 'employer': 'slate' }
|
* // => { 'name': 'fred', 'age': 40, 'employer': 'slate' }
|
||||||
*/
|
*/
|
||||||
function findWhere(collection, source) {
|
function findWhere(collection, source) {
|
||||||
return find(collection, isObject(source) ? source : {});
|
return find(collection, Object(source));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -4858,7 +4858,7 @@
|
|||||||
* // => ['barney', 'fred']
|
* // => ['barney', 'fred']
|
||||||
*/
|
*/
|
||||||
function where(collection, source) {
|
function where(collection, source) {
|
||||||
return filter(collection, isObject(source) ? source : {});
|
return filter(collection, Object(source));
|
||||||
}
|
}
|
||||||
|
|
||||||
/*--------------------------------------------------------------------------*/
|
/*--------------------------------------------------------------------------*/
|
||||||
|
|||||||
Reference in New Issue
Block a user