(expression, comparator, matchAgainstAnyProp)
| 16656 | |
| 16657 | // Helper functions for `filterFilter` |
| 16658 | function createPredicateFn(expression, comparator, matchAgainstAnyProp) { |
| 16659 | var predicateFn; |
| 16660 | |
| 16661 | if (comparator === true) { |
| 16662 | comparator = equals; |
| 16663 | } else if (!isFunction(comparator)) { |
| 16664 | comparator = function(actual, expected) { |
| 16665 | if (isObject(actual) || isObject(expected)) { |
| 16666 | // Prevent an object to be considered equal to a string like `'[object'` |
| 16667 | return false; |
| 16668 | } |
| 16669 | |
| 16670 | actual = lowercase('' + actual); |
| 16671 | expected = lowercase('' + expected); |
| 16672 | return actual.indexOf(expected) !== -1; |
| 16673 | }; |
| 16674 | } |
| 16675 | |
| 16676 | predicateFn = function(item) { |
| 16677 | return deepCompare(item, expression, comparator, matchAgainstAnyProp); |
| 16678 | }; |
| 16679 | |
| 16680 | return predicateFn; |
| 16681 | } |
| 16682 | |
| 16683 | function deepCompare(actual, expected, comparator, matchAgainstAnyProp) { |
| 16684 | var actualType = typeof actual; |
no test coverage detected