MCPcopy Index your code
hub / github.com/nodejs/node / partialSparseArrayEquiv

Function partialSparseArrayEquiv

lib/internal/util/comparisons.js:923–943  ·  view source on GitHub ↗
(a, b, mode, memos, startA, startB)

Source from the content-addressed store, hash-verified

921}
922
923function partialSparseArrayEquiv(a, b, mode, memos, startA, startB) {
924 let aPos = startA;
925 const keysA = ObjectKeys(a);
926 const keysB = ObjectKeys(b);
927 const lenA = keysA.length - startA;
928 const lenB = keysB.length - startB;
929 if (lenA < lenB) {
930 return false;
931 }
932 for (let i = 0; i < lenB; i++) {
933 const keyB = keysB[startB + i];
934 while (!innerDeepEqual(a[keysA[aPos]], b[keyB], mode, memos)) {
935 aPos++;
936 if (aPos > keysA.length - lenB + i) {
937 return false;
938 }
939 }
940 aPos++;
941 }
942 return true;
943}
944
945function partialArrayEquiv(a, b, mode, memos) {
946 let aPos = 0;

Callers 1

partialArrayEquivFunction · 0.85

Calls 1

innerDeepEqualFunction · 0.85

Tested by

no test coverage detected