MCPcopy Create free account
hub / github.com/backnotprop/plannotator / loadConfig

Function loadConfig

packages/shared/config.ts:154–164  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

152 * Returns {} on missing file or malformed JSON.
153 */
154export function loadConfig(): PlannotatorConfig {
155 try {
156 if (!existsSync(CONFIG_PATH)) return {};
157 const raw = readFileSync(CONFIG_PATH, "utf-8");
158 const parsed = JSON.parse(raw);
159 return typeof parsed === "object" && parsed !== null ? parsed : {};
160 } catch (e) {
161 process.stderr.write(`[plannotator] Warning: failed to read config.json: ${e}\n`);
162 return {};
163 }
164}
165
166/**
167 * Save config by merging partial values into the existing file.

Callers 15

getConfiguredPromptFunction · 0.90
fetchFunction · 0.90
openBrowserFunction · 0.90
startReviewServerFunction · 0.90
getSharingEnabledFunction · 0.90
PlannotatorPluginFunction · 0.90
handleReviewCommandFunction · 0.90
handleAnnotateCommandFunction · 0.90
index.tsFile · 0.90
saveConfigFunction · 0.85
getServerConfigFunction · 0.85
configureServerFunction · 0.85

Calls 1

parseMethod · 0.80

Tested by

no test coverage detected