Ensure arrayHasDiff returns a boolean

This is just maintenance noticed while debugging.
This commit is contained in:
Travis Ralston 2020-07-27 17:17:27 -06:00
parent 51592ccfb6
commit 5f034ee4ed

View file

@ -53,6 +53,9 @@ export function arrayHasDiff(a: any[], b: any[]): boolean {
// an element from the other. // an element from the other.
if (b.some(i => !a.includes(i))) return true; if (b.some(i => !a.includes(i))) return true;
if (a.some(i => !b.includes(i))) return true; if (a.some(i => !b.includes(i))) return true;
// if all the keys are common, say so
return false
} else { } else {
return true; // different lengths means they are naturally diverged return true; // different lengths means they are naturally diverged
} }