MCPcopy
hub / github.com/21st-dev/1code / readJsonFile

Function readJsonFile

src/main/lib/git/worktree-config.ts:34–41  ·  view source on GitHub ↗
(filePath: string)

Source from the content-addressed store, hash-verified

32}
33
34async function readJsonFile<T>(filePath: string): Promise<T | null> {
35 try {
36 const content = await readFile(filePath, "utf-8")
37 return JSON.parse(content) as T
38 } catch {
39 return null
40 }
41}
42
43/**
44 * Detect worktree config for a project

Callers

nothing calls this directly

Calls 1

readFileFunction · 0.85

Tested by

no test coverage detected