MCPcopy Index your code
hub / github.com/Opencode-DCP/opencode-dynamic-context-pruning / readFileIfExists

Function readFileIfExists

lib/prompts/store.ts:312–322  ·  view source on GitHub ↗
(filePath: string)

Source from the content-addressed store, hash-verified

310}
311
312function readFileIfExists(filePath: string): string | null {
313 if (!existsSync(filePath)) {
314 return null
315 }
316
317 try {
318 return readFileSync(filePath, "utf-8")
319 } catch {
320 return null
321 }
322}
323
324export class PromptStore {
325 private readonly logger: Logger

Callers 2

reloadMethod · 0.85
ensureDefaultFilesMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected