MCPcopy Create free account
hub / github.com/anonymousRAID/OSINT-Mapping-Tool / clearLocalConfigKey

Function clearLocalConfigKey

src/utils/appConfig.js:136–149  ·  view source on GitHub ↗
(section, key)

Source from the content-addressed store, hash-verified

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. */
136export 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
151export const APP_CONFIG_PATH_HINT = 'public/app.config.json';

Callers

nothing calls this directly

Calls 1

readLocalStorageFunction · 0.85

Tested by

no test coverage detected