mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-28 23:46:58 -05:00
Fix edge function logging and types
This commit is contained in:
@@ -15,7 +15,7 @@ interface EntityEditPreviewProps {
|
||||
/**
|
||||
* Deep equality check for detecting changes in nested objects/arrays
|
||||
*/
|
||||
const deepEqual = (a: any, b: any): boolean => {
|
||||
const deepEqual = <T extends Record<string, unknown>>(a: T, b: T): boolean => {
|
||||
// Handle null/undefined cases
|
||||
if (a === b) return true;
|
||||
if (a == null || b == null) return false;
|
||||
@@ -27,7 +27,7 @@ const deepEqual = (a: any, b: any): boolean => {
|
||||
// Handle arrays
|
||||
if (Array.isArray(a) && Array.isArray(b)) {
|
||||
if (a.length !== b.length) return false;
|
||||
return a.every((item, index) => deepEqual(item, b[index]));
|
||||
return a.every((item, index) => deepEqual(item as Record<string, unknown>, b[index] as Record<string, unknown>));
|
||||
}
|
||||
|
||||
// One is array, other is not
|
||||
@@ -39,7 +39,16 @@ const deepEqual = (a: any, b: any): boolean => {
|
||||
|
||||
if (keysA.length !== keysB.length) return false;
|
||||
|
||||
return keysA.every(key => deepEqual(a[key], b[key]));
|
||||
return keysA.every(key => {
|
||||
const valueA = a[key];
|
||||
const valueB = b[key];
|
||||
|
||||
if (typeof valueA === 'object' && valueA !== null && typeof valueB === 'object' && valueB !== null) {
|
||||
return deepEqual(valueA as Record<string, unknown>, valueB as Record<string, unknown>);
|
||||
}
|
||||
|
||||
return valueA === valueB;
|
||||
});
|
||||
};
|
||||
|
||||
interface ImageAssignments {
|
||||
|
||||
Reference in New Issue
Block a user