(section, key)
| 134 | /** Remove a single key (e.g. "mapId") from a section without nuking the whole |
| 135 | * section. Used so clearing the LS Map ID doesn't also clear the LS API key. */ |
| 136 | export function clearLocalConfigKey(section, key) { |
| 137 | const current = readLocalStorage() ?? {}; |
| 138 | if (current[section] && key in current[section]) { |
| 139 | const sectionCopy = { ...current[section] }; |
| 140 | delete sectionCopy[key]; |
| 141 | if (Object.keys(sectionCopy).length === 0) { |
| 142 | delete current[section]; |
| 143 | } else { |
| 144 | current[section] = sectionCopy; |
| 145 | } |
| 146 | localStorage.setItem(STORAGE_KEY, JSON.stringify(current)); |
| 147 | } |
| 148 | return current; |
| 149 | } |
| 150 | |
| 151 | export const APP_CONFIG_PATH_HINT = 'public/app.config.json'; |
nothing calls this directly
no test coverage detected