Superdiff provides a complete and readable diff for both arrays and objects. Plus, it supports stream and file inputs for handling large datasets efficiently, is battle-tested, has zero dependencies, and is super fast.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

14 lines
412 B

export function isEqual(a: any, b: any): boolean {
if (typeof a !== typeof b) return true;
if (Array.isArray(a)) {
return a.toString() === b.toString();
}
if (typeof a === "object") {
return JSON.stringify(a) === JSON.stringify(b);
}
return a === b;
}
export function hasNestedValues(value: any): value is Record<string, any> {
return typeof value === "object" && !Array.isArray(value);
}