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

Function stringifyJsonc

packages/dashboard/src/lib/jsonc.ts:30–36  ·  view source on GitHub ↗
(root: Record<string, unknown>)

Source from the content-addressed store, hash-verified

28}
29
30function stringifyJsonc(root: Record<string, unknown>): string {
31 const rendered = stringify(root, null, 2);
32 if (typeof rendered !== "string") {
33 throw new Error("Failed to serialize config JSONC");
34 }
35 return `${rendered}\n`;
36}
37
38/** Pretty-print a new JSONC object. Existing files should use patch helpers to preserve comments. */
39export function formatJsonc(value: unknown): string {

Callers 14

writePiSettingsPackageFunction · 0.85
writeMagicContextConfigFunction · 0.85
addPluginToTuiConfigFunction · 0.85
writeMagicContextConfigFunction · 0.85
writePiSettingsFunction · 0.85
ensurePluginEntryMethod · 0.85
removePluginEntryMethod · 0.85
formatJsoncFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected