(array, a, b, mode, memo)
| 680 | } |
| 681 | |
| 682 | function setObjectEquiv(array, a, b, mode, memo) { |
| 683 | let direction = 1; |
| 684 | let start = 0; |
| 685 | let end = array.length - 1; |
| 686 | const comparator = mode !== kLoose ? objectComparisonStart : innerDeepEqual; |
| 687 | const extraChecks = mode === kLoose || array.length !== a.size; |
| 688 | for (const val1 of a) { |
| 689 | if (extraChecks) { |
| 690 | if (typeof val1 === 'object') { |
| 691 | if (b.has(val1)) { |
| 692 | continue; |
| 693 | } |
| 694 | } else if (b.has(val1)) { |
| 695 | continue; |
| 696 | } else if (mode !== kLoose) { |
| 697 | return false; |
| 698 | } |
| 699 | } |
| 700 | |
| 701 | let innerStart = start; |
| 702 | if (direction === 1) { |
| 703 | if (comparator(val1, array[start], mode, memo)) { |
| 704 | start += 1; |
| 705 | continue; |
| 706 | } |
| 707 | if (start === end) { |
| 708 | return false; |
| 709 | } |
| 710 | direction = -1; |
| 711 | innerStart += 1; |
| 712 | } |
| 713 | if (!comparator(val1, array[end], mode, memo)) { |
| 714 | direction = 1; |
| 715 | if (!arrayHasEqualElement(array, val1, mode, memo, comparator, innerStart, end)) { |
| 716 | return false; |
| 717 | } |
| 718 | } |
| 719 | end -= 1; |
| 720 | } |
| 721 | return true; |
| 722 | } |
| 723 | |
| 724 | function compareSmallSets(a, b, val, iteratorB, mode, memo) { |
| 725 | const iteratorA = a.values(); |
no test coverage detected
searching dependent graphs…