MCPcopy
hub / github.com/compiler-explorer/compiler-explorer / tryReadJsonFile

Function tryReadJsonFile

lib/utils.ts:648–651  ·  view source on GitHub ↗
(filename: string)

Source from the content-addressed store, hash-verified

646 * Try and read a file as a utf-8 json file, returning its contents if present, or undefined if not.
647 */
648export async function tryReadJsonFile(filename: string): Promise<any | undefined> {
649 const text = await tryReadTextFile(filename);
650 return text === undefined ? undefined : JSON.parse(text);
651}
652
653/**
654 * Output a file, creating any necessary directories.

Callers

nothing calls this directly

Calls 2

tryReadTextFileFunction · 0.85
parseMethod · 0.45

Tested by

no test coverage detected