Loosen _.matches to match objects with inherited properties. [closes #1067]

This commit is contained in:
jdalton
2015-03-21 23:33:19 -07:00
parent 8930e6b393
commit f20d8f5cc0
2 changed files with 40 additions and 34 deletions

View File

@@ -9634,7 +9634,7 @@
objects = [{ 'a': 1 }, { 'a': 1, 'b': 1 }, { 'a': 1, 'b': undefined }],
actual = _.map(objects, matches);
deepEqual(actual, [true, false, true]);
deepEqual(actual, [false, false, true]);
matches = _.matchesProperty('a', { 'b': undefined });
objects = [{ 'a': { 'a': 1 } }, { 'a': { 'a': 1, 'b': 1 } }, { 'a': { 'a': 1, 'b': undefined } }];