<NME> object-compare.ts
<BEF> export function isEqual<T>(a: Object, b: Object): boolean;
export function isEqual<T>(a: T, b: T): boolean;
export function isEqual<T>(a: Array<T>, b: Array<T>): boolean;
export function isEqual<T>(a: any, b: any): boolean {
    if (typeof a === 'object') {
        if (Object.keys(a).length !== Object.keys(b).length) {
            // 'b' has a different number of properties, and thus can no longer be considered equal.
            console.warn(
                `Property count mismatch (a: ${Object.keys(a).length} keys,`
                + ` b: ${Object.keys(b).length} keys) on:`,
            );
            console.warn(a);
            console.warn(b);
            return false;
        } else {
            // Alphabetical iteration over object property keys.
            return Object.keys(a).sort().reduce((acc, k) => {
                if (typeof a[k] === 'function' && typeof b[k] === 'function') {
                    return true;
                } else {
                    return acc && isEqual(a[k], b[k]);
                }
            }, true);
        }
    } else if (a instanceof Array && b instanceof Array) {
        if (a.length !== b.length) {
            // 'b' has a different number of elements, not equal.
            console.warn(
                `Array length mismatch (a: ${a.length} elements, b: ${b.length} elements) on:`,
            );
            console.warn(a);
            console.warn(b);
            return false;
        } else {
            // Compare all Array elements recursively.
            for (let i = 0; i < a.length; i++) {
                if (!isEqual(a[i], b[i])) {
                    // Array elements not equal.
                    return false;
                }
            }
        }
    } else if (a !== b) {
        console.warn(`Value mismatch (a: '${a}', b: '${b}').`);
        return false;
    } else {
        return true;
    }
    return false;
}

<MSG> Fix negated conditions

<DFF> @@ -3,16 +3,7 @@ export function isEqual<T>(a: T, b: T): boolean;
 export function isEqual<T>(a: Array<T>, b: Array<T>): boolean;
 export function isEqual<T>(a: any, b: any): boolean {
     if (typeof a === 'object') {
-        if (Object.keys(a).length !== Object.keys(b).length) {
-            // 'b' has a different number of properties, and thus can no longer be considered equal.
-            console.warn(
-                `Property count mismatch (a: ${Object.keys(a).length} keys,`
-                + ` b: ${Object.keys(b).length} keys) on:`,
-            );
-            console.warn(a);
-            console.warn(b);
-            return false;
-        } else {
+        if (Object.keys(a).length === Object.keys(b).length) {
             // Alphabetical iteration over object property keys.
             return Object.keys(a).sort().reduce((acc, k) => {
                 if (typeof a[k] === 'function' && typeof b[k] === 'function') {
@@ -21,17 +12,18 @@ export function isEqual<T>(a: any, b: any): boolean {
                     return acc && isEqual(a[k], b[k]);
                 }
             }, true);
-        }
-    } else if (a instanceof Array && b instanceof Array) {
-        if (a.length !== b.length) {
-            // 'b' has a different number of elements, not equal.
+        } else {
+            // 'b' has a different number of properties, and thus can no longer be considered equal.
             console.warn(
-                `Array length mismatch (a: ${a.length} elements, b: ${b.length} elements) on:`,
+                `Property count mismatch (a: ${Object.keys(a).length} keys,`
+                + ` b: ${Object.keys(b).length} keys) on:`,
             );
             console.warn(a);
             console.warn(b);
             return false;
-        } else {
+        }
+    } else if (a instanceof Array && b instanceof Array) {
+        if (a.length === b.length) {
             // Compare all Array elements recursively.
             for (let i = 0; i < a.length; i++) {
                 if (!isEqual(a[i], b[i])) {
@@ -39,12 +31,19 @@ export function isEqual<T>(a: any, b: any): boolean {
                     return false;
                 }
             }
+        } else {
+            // 'b' has a different number of elements, not equal.
+            console.warn(
+                `Array length mismatch (a: ${a.length} elements, b: ${b.length} elements) on:`,
+            );
+            console.warn(a);
+            console.warn(b);
+            return false;
         }
-    } else if (a !== b) {
-        console.warn(`Value mismatch (a: '${a}', b: '${b}').`);
-        return false;
-    } else {
+    } else if (a === b) {
         return true;
     }
+
+    console.warn(`Value mismatch (a: '${a}', b: '${b}').`);
     return false;
 }

Fix negated conditions