()
| 73 | } |
| 74 | |
| 75 | function migratePrefixKeys() { |
| 76 | for (const [oldPrefix, newPrefix] of PREFIX_RENAMES) { |
| 77 | const keysToMigrate: [string, string][] = []; |
| 78 | for (let i = 0; i < localStorage.length; i++) { |
| 79 | const key = localStorage.key(i); |
| 80 | if (key?.startsWith(oldPrefix)) { |
| 81 | const suffix = key.slice(oldPrefix.length); |
| 82 | keysToMigrate.push([key, `${newPrefix}${suffix}`]); |
| 83 | } |
| 84 | } |
| 85 | for (const [oldKey, newKey] of keysToMigrate) { |
| 86 | moveKey(oldKey, newKey); |
| 87 | } |
| 88 | } |
| 89 | } |
| 90 | |
| 91 | function migrateUIScopeKeys() { |
| 92 | // Old UI state keys used different prefixes scoped by email: |
no test coverage detected