(array, a, b, mode, memo)
| 833 | } |
| 834 | |
| 835 | function mapObjectEquiv(array, a, b, mode, memo) { |
| 836 | let direction = 1; |
| 837 | let start = 0; |
| 838 | let end = array.length - 1; |
| 839 | const comparator = mode !== kLoose ? objectComparisonStart : innerDeepEqual; |
| 840 | const extraChecks = mode === kLoose || array.length !== a.size; |
| 841 | |
| 842 | for (const { 0: key1, 1: item1 } of a) { |
| 843 | if (extraChecks && (typeof key1 !== 'object' || key1 === null)) { |
| 844 | if (b.has(key1)) { |
| 845 | if (mode !== kLoose || innerDeepEqual(item1, b.get(key1), mode, memo)) { |
| 846 | continue; |
| 847 | } |
| 848 | } else if (mode !== kLoose) { |
| 849 | return false; |
| 850 | } |
| 851 | } |
| 852 | |
| 853 | let innerStart = start; |
| 854 | if (direction === 1) { |
| 855 | const key2 = array[start]; |
| 856 | if (comparator(key1, key2, mode, memo) && innerDeepEqual(item1, b.get(key2), mode, memo)) { |
| 857 | start += 1; |
| 858 | continue; |
| 859 | } |
| 860 | if (start === end) { |
| 861 | return false; |
| 862 | } |
| 863 | direction = -1; |
| 864 | innerStart += 1; |
| 865 | } |
| 866 | const key2 = array[end]; |
| 867 | if ((!comparator(key1, key2, mode, memo) || !innerDeepEqual(item1, b.get(key2), mode, memo))) { |
| 868 | direction = 1; |
| 869 | if (!arrayHasEqualMapElement(array, key1, item1, b, mode, memo, comparator, innerStart, end)) { |
| 870 | return false; |
| 871 | } |
| 872 | } |
| 873 | end -= 1; |
| 874 | } |
| 875 | return true; |
| 876 | } |
| 877 | |
| 878 | function mapEquiv(a, b, mode, memo) { |
| 879 | let array; |
no test coverage detected
searching dependent graphs…