mirror of
https://gitlab.com/lecarore/breakout71.git
synced 2025-04-20 12:15:06 -04:00
12 lines
454 B
TypeScript
12 lines
454 B
TypeScript
export function generateSaveFileContent() {
|
|
const localStorageContent: Record<string, string> = {};
|
|
|
|
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);
|
|
}
|