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

Function readJsonc

packages/cli/src/commands/setup-opencode.ts:33–41  ·  view source on GitHub ↗
(path: string)

Source from the content-addressed store, hash-verified

31}
32
33function readJsonc(path: string): Record<string, unknown> | null {
34 const content = readFileSync(path, "utf-8");
35 try {
36 return parseJsonc(content) as Record<string, unknown>;
37 } catch (err) {
38 console.error(` ⚠ Failed to parse ${path}: ${err instanceof Error ? err.message : err}`);
39 return null;
40 }
41}
42// ─── Config Manipulators ──────────────────────────────────
43
44function addPluginToOpenCodeConfig(configPath: string, format: "json" | "jsonc" | "none"): void {

Callers 4

addPluginToTuiConfigFunction · 0.70
writeMagicContextConfigFunction · 0.70

Calls 2

errorMethod · 0.80
parseJsoncFunction · 0.50

Tested by

no test coverage detected