mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-01 15:57:48 +00:00
Make _.where search arrays for values.
Former-commit-id: b942c6a44680c78fae1a41f2cf994be09ffcfbb9
This commit is contained in:
@@ -2607,6 +2607,14 @@
|
||||
|
||||
deepEqual(_.where(collection, { 'a': { 'b': { 'c': 1 } } }), expected);
|
||||
});
|
||||
|
||||
test('should search of arrays for values', function() {
|
||||
var collection = [{ 'a': [1, 2] }],
|
||||
expected = _.cloneDeep(collection);
|
||||
|
||||
deepEqual(_.where(collection, { 'a': [] }), []);
|
||||
deepEqual(_.where(collection, { 'a': [2] }), expected);
|
||||
});
|
||||
}());
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
Reference in New Issue
Block a user