breakout71/src/generateSaveFileContent.ts

13 lines
454 B
TypeScript
Raw Normal View History

2025-04-06 18:21:53 +02:00
export function generateSaveFileContent() {
2025-04-07 14:08:48 +02:00
const localStorageContent: Record<string, string> = {};
2025-04-06 18:21:53 +02:00
2025-04-07 14:08:48 +02:00
for (let i = 0; i < localStorage.length; i++) {
const key = localStorage.key(i) as string;
// Avoid including recovery info in the recovery info
if (["recovery_data"].includes(key)) continue;
const value = localStorage.getItem(key) as string;
localStorageContent[key] = value;
}
return JSON.stringify(localStorageContent);
}