MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / loadParsedConfig

Function loadParsedConfig

src/project-config.ts:272–290  ·  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

270 * read/parse) while a single config file is in force, shared across every field.
271 */
272function loadParsedConfig(rootDir: string): ParsedConfig {
273 const file = path.join(rootDir, PROJECT_CONFIG_FILENAME);
274
275 let mtimeMs: number;
276 try {
277 mtimeMs = fs.statSync(file).mtimeMs;
278 } catch {
279 // No config file — drop any stale cache entry and return the default.
280 cache.delete(rootDir);
281 return EMPTY_CONFIG;
282 }
283
284 const entry = cache.get(rootDir);
285 if (entry && entry.mtimeMs === mtimeMs) return entry.config;
286
287 const config = parseConfig(file);
288 cache.set(rootDir, { mtimeMs, config });
289 return config;
290}
291
292/**
293 * Load the validated extension overrides for a project, mtime-cached.

Callers 4

loadExtensionOverridesFunction · 0.85
loadExcludePatternsFunction · 0.85
loadIncludePatternsFunction · 0.85

Calls 4

parseConfigFunction · 0.70
getMethod · 0.65
joinMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected