MCPcopy
hub / github.com/github/awesome-copilot / loadState

Function loadState

extensions/site-studio/extension.mjs:599–612  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

597}
598
599async function loadState() {
600 if (stateLoaded) {
601 return stateCache;
602 }
603 try {
604 const content = await readFile(STATE_FILE, "utf8");
605 stateCache = normalizeState(JSON.parse(content));
606 } catch {
607 stateCache = createInitialState();
608 await persistState();
609 }
610 stateLoaded = true;
611 return stateCache;
612}
613
614function escapeHtml(value) {
615 return String(value)

Callers 3

mutateStateFunction · 0.70
handleApiFunction · 0.70
extension.mjsFile · 0.70

Calls 3

createInitialStateFunction · 0.85
persistStateFunction · 0.85
normalizeStateFunction · 0.70

Tested by

no test coverage detected