Refactor code structure for improved readability and maintainability
All checks were successful
Deploy tt-tagebuch / deploy (push) Successful in 53s

This commit is contained in:
Torsten Schulz (local)
2026-05-27 23:53:41 +02:00
parent 2e7cf0c28d
commit e57cdc6ad8
25 changed files with 156689 additions and 171 deletions

View File

@@ -0,0 +1,12 @@
export function normalizeStoredDrawingData(value) {
if (!value) return null;
let normalized = value;
for (let pass = 0; pass < 2 && typeof normalized === 'string'; pass += 1) {
try {
normalized = JSON.parse(normalized);
} catch (error) {
return value;
}
}
return typeof normalized === 'string' ? normalized : JSON.stringify(normalized);
}