interstellar_ai/app/backend/GetLocalStorage.ts

16 lines
437 B
TypeScript
Raw Normal View History

// getLocalStorageData.ts
export const getAllLocalStorageItems = (): Record<string, string | null> => {
const allData: Record<string, string | null> = {};
2024-10-07 11:16:51 +02:00
if (typeof localStorage !== 'undefined') {
for (let i = 0; i < localStorage.length; i++) {
const key = localStorage.key(i);
if (key) {
const value = localStorage.getItem(key);
allData[key] = value;
}
}
2024-10-07 11:16:51 +02:00
}
return allData;
};