MCPcopy Create free account
hub / github.com/DanWahlin/CustomerManagerStandard / __arrayEquals

Function __arrayEquals

CustomerManager/Scripts/breeze.debug.js:368–389  ·  view source on GitHub ↗
(a1, a2, equalsFn)

Source from the content-addressed store, hash-verified

366 //}
367
368 function __arrayEquals(a1, a2, equalsFn) {
369 //Check if the arrays are undefined/null
370 if (!a1 || !a2) return false;
371
372 if (a1.length !== a2.length) return false;
373
374 //go thru all the vars
375 for (var i = 0; i < a1.length; i++) {
376 //if the var is an array, we need to make a recursive check
377 //otherwise we'll just compare the values
378 if (Array.isArray(a1[i])) {
379 if (!__arrayEquals(a1[i], a2[i])) return false;
380 } else {
381 if (equalsFn) {
382 if (!equalsFn(a1[i], a2[i])) return false;
383 } else {
384 if (a1[i] !== a2[i]) return false;
385 }
386 }
387 }
388 return true;
389 }
390
391 // end of array functions
392

Callers 1

breeze.debug.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected