mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-24 10:11:13 -05:00
Implement comprehensive fix
This commit is contained in:
@@ -9,7 +9,12 @@ function hashContent(obj: any): string {
|
||||
if (obj === null || obj === undefined) return 'null';
|
||||
if (typeof obj !== 'object') return String(obj);
|
||||
|
||||
// Sort keys for stable hashing
|
||||
// Handle arrays
|
||||
if (Array.isArray(obj)) {
|
||||
return `[${obj.map(hashContent).join(',')}]`;
|
||||
}
|
||||
|
||||
// Sort keys for stable hashing (CRITICAL for nested objects!)
|
||||
const sortedKeys = Object.keys(obj).sort();
|
||||
const parts = sortedKeys.map(key => `${key}:${hashContent(obj[key])}`);
|
||||
return parts.join('|');
|
||||
|
||||
Reference in New Issue
Block a user