MCPcopy Create free account
hub / github.com/Gan-Xing/CodexBridge / readJsonObject

Function readJsonObject

packages/codex-native-api/src/auth_state.ts:271–278  ·  view source on GitHub ↗
(filePath: string)

Source from the content-addressed store, hash-verified

269}
270
271function readJsonObject(filePath: string): Record<string, unknown> | null {
272 try {
273 const raw = JSON.parse(fs.readFileSync(filePath, 'utf8'));
274 return isRecord(raw) ? raw : null;
275 } catch {
276 return null;
277 }
278}
279
280async function writeJsonAtomic(filePath: string, value: Record<string, unknown>): Promise<void> {
281 const directory = path.dirname(filePath);

Callers 2

readCodexAuthStateFunction · 0.70
writeCodexAuthFileFunction · 0.70

Calls 1

isRecordFunction · 0.70

Tested by

no test coverage detected