MCPcopy Index your code
hub / github.com/callstack/agent-device / readJsonFile

Function readJsonFile

src/daemon/client/daemon-client-metadata.ts:256–263  ·  view source on GitHub ↗
(filePath: string)

Source from the content-addressed store, hash-verified

254}
255
256function readJsonFile(filePath: string): unknown | null {
257 if (!fs.existsSync(filePath)) return null;
258 try {
259 return JSON.parse(fs.readFileSync(filePath, 'utf8')) as unknown;
260 } catch {
261 return null;
262 }
263}
264
265function removeFileIfExists(filePath: string): void {
266 try {

Callers 2

readDaemonInfoFunction · 0.85
readDaemonLockInfoFunction · 0.85

Calls 1

parseMethod · 0.45

Tested by

no test coverage detected