Implement comprehensive fix

This commit is contained in:
gpt-engineer-app[bot]
2025-10-06 19:38:39 +00:00
parent d965d2c299
commit fd20c02e5e
2 changed files with 121 additions and 50 deletions

View File

@@ -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('|');