MCPcopy Create free account
hub / github.com/Acode-Foundation/Acode / clear

Method clear

src/lib/installState.js:119–139  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

117 }
118
119 async clear() {
120 try {
121 this.store = {};
122 this.updatedStore = {};
123 // Delete the state file entirely to avoid corrupted/partial JSON issues
124 if (await fsOperation(this.storeUrl).exists()) {
125 try {
126 await fsOperation(this.storeUrl).delete();
127 } catch (delErr) {
128 console.error(
129 "InstallState: Failed to delete state file during clear:",
130 delErr,
131 );
132 // As a fallback, overwrite with a valid empty JSON
133 await fsOperation(this.storeUrl).writeFile("{}");
134 }
135 }
136 } catch (error) {
137 console.error("Failed to clear install state:", error);
138 }
139 }
140}
141
142/**

Callers 13

applyPluginUpdatesFunction · 0.45
clearHighlightCacheFunction · 0.45
initHighlightingFunction · 0.45
flushLogsMethod · 0.45
recentFunction · 0.45
constructorMethod · 0.45
installPluginFunction · 0.45
clearFunction · 0.45
tester.jsFile · 0.45
onFileRemovedFunction · 0.45
getWorkerFunction · 0.45
stopFunction · 0.45

Calls 5

fsOperationFunction · 0.85
existsMethod · 0.65
deleteMethod · 0.65
errorMethod · 0.45
writeFileMethod · 0.45

Tested by

no test coverage detected