MCPcopy Create free account
hub / github.com/cortexkit/magic-context / readJsoncFile

Function readJsoncFile

packages/plugin/src/shared/jsonc-parser.ts:114–120  ·  view source on GitHub ↗
(filePath: string)

Source from the content-addressed store, hash-verified

112}
113
114export function readJsoncFile<T = unknown>(filePath: string): T | null {
115 try {
116 return parseJsonc<T>(readFileSync(filePath, "utf-8"));
117 } catch (_error) {
118 return null;
119 }
120}
121
122export function detectConfigFile(basePath: string): {
123 format: "json" | "jsonc" | "none";

Callers 6

readUserCompactionConfigFunction · 0.90
readProjectCompactionFunction · 0.90
readUserCompactionFunction · 0.90
collectPluginEntriesFunction · 0.90
readOmoDisabledHooksFunction · 0.90

Calls 1

parseJsoncFunction · 0.70

Tested by

no test coverage detected