fix deep compare short path for falsy / null

This commit is contained in:
mbecker20
2026-03-25 02:27:46 -07:00
parent 150a8a160d
commit 4626b4a477
+5
View File
@@ -357,6 +357,11 @@ export function listsEqual(a: string[], b: string[]) {
* @returns a === b
*/
export function deepCompare(a: any, b: any) {
// Short path for falsy. Important to catch typeof null === "object" edge case.
if (!a || !b) {
return a === b;
}
const ta = typeof a;
const tb = typeof b;