(a, b, mode, memo)
| 876 | } |
| 877 | |
| 878 | function mapEquiv(a, b, mode, memo) { |
| 879 | let array; |
| 880 | |
| 881 | for (const { 0: key2, 1: item2 } of b) { |
| 882 | if (typeof key2 === 'object' && key2 !== null) { |
| 883 | if (array === undefined) { |
| 884 | if (a.size === 1) { |
| 885 | const { 0: key1, 1: item1 } = a.entries().next().value; |
| 886 | return innerDeepEqual(key1, key2, mode, memo) && |
| 887 | innerDeepEqual(item1, item2, mode, memo); |
| 888 | } |
| 889 | array = []; |
| 890 | } |
| 891 | array.push(key2); |
| 892 | } else { |
| 893 | // By directly retrieving the value we prevent another b.has(key2) check in |
| 894 | // almost all possible cases. |
| 895 | const item1 = a.get(key2); |
| 896 | if (((item1 === undefined && !a.has(key2)) || |
| 897 | !innerDeepEqual(item1, item2, mode, memo))) { |
| 898 | if (mode !== kLoose) |
| 899 | return false; |
| 900 | // Fast path to detect missing string, symbol, undefined and null |
| 901 | // keys. |
| 902 | if (!mapMightHaveLoosePrim(a, b, key2, item2, memo)) |
| 903 | return false; |
| 904 | if (array === undefined) { |
| 905 | array = []; |
| 906 | } |
| 907 | array.push(key2); |
| 908 | } |
| 909 | } |
| 910 | } |
| 911 | |
| 912 | if (array === undefined) { |
| 913 | return true; |
| 914 | } |
| 915 | |
| 916 | if (mode === kPartial) { |
| 917 | return partialObjectMapEquiv(array, a, b, mode, memo); |
| 918 | } |
| 919 | |
| 920 | return mapObjectEquiv(array, a, b, mode, memo); |
| 921 | } |
| 922 | |
| 923 | function partialSparseArrayEquiv(a, b, mode, memos, startA, startB) { |
| 924 | let aPos = startA; |
no test coverage detected
searching dependent graphs…