MCPcopy Create free account
hub / github.com/T-Lab-CUHKSZ/claude-code / writeJsonSafe

Function writeJsonSafe

config-ui/server.ts:73–77  ·  view source on GitHub ↗
(path: string, data: any)

Source from the content-addressed store, hash-verified

71}
72
73function writeJsonSafe(path: string, data: any) {
74 const dir = dirname(path)
75 if (!existsSync(dir)) mkdirSync(dir, { recursive: true })
76 writeFileSync(path, JSON.stringify(data, null, 2) + '\n')
77}
78
79function readTextSafe(path: string): string {
80 try {

Callers 1

handleAPIFunction · 0.85

Calls 2

existsSyncFunction · 0.90
mkdirSyncFunction · 0.90

Tested by

no test coverage detected