(stored: string | null)
| 43 | } |
| 44 | |
| 45 | export function parseProfilesDataJson(stored: string | null): ProfilesData { |
| 46 | if (!stored) return DEFAULT_PROFILES_DATA; |
| 47 | |
| 48 | try { |
| 49 | return normalizeProfilesData(JSON.parse(stored)); |
| 50 | } catch { |
| 51 | return DEFAULT_PROFILES_DATA; |
| 52 | } |
| 53 | } |
| 54 | |
| 55 | export function serializeProfilesData(data: ProfilesData): string { |
| 56 | const { [DEFAULT_PROFILE_NAME]: _default, ...userProfiles } = data.profiles; |
no test coverage detected