MCPcopy
hub / github.com/colbymchenry/codegraph / loadParsedConfig

Function loadParsedConfig

src/project-config.ts:222–240  ·  view source on GitHub ↗

* Load the parsed `codegraph.json` for a project, mtime-cached. A missing or * malformed file yields the zero-config default. One `stat` (and at most one * read/parse) while a single config file is in force, shared across every field.

(rootDir: string)

Source from the content-addressed store, hash-verified

220 * read/parse) while a single config file is in force, shared across every field.
221 */
222function loadParsedConfig(rootDir: string): ParsedConfig {
223 const file = path.join(rootDir, PROJECT_CONFIG_FILENAME);
224
225 let mtimeMs: number;
226 try {
227 mtimeMs = fs.statSync(file).mtimeMs;
228 } catch {
229 // No config file — drop any stale cache entry and return the default.
230 cache.delete(rootDir);
231 return EMPTY_CONFIG;
232 }
233
234 const entry = cache.get(rootDir);
235 if (entry && entry.mtimeMs === mtimeMs) return entry.config;
236
237 const config = parseConfig(file);
238 cache.set(rootDir, { mtimeMs, config });
239 return config;
240}
241
242/**
243 * Load the validated extension overrides for a project, mtime-cached.

Callers 3

loadExtensionOverridesFunction · 0.85
loadExcludePatternsFunction · 0.85

Calls 4

joinMethod · 0.80
setMethod · 0.80
parseConfigFunction · 0.70
getMethod · 0.65

Tested by

no test coverage detected