MCPcopy Create free account
hub / github.com/ZenNotes/zennotes / readConfigFile

Function readConfigFile

apps/desktop/src/main/vault.ts:470–480  ·  view source on GitHub ↗
(target: string)

Source from the content-addressed store, hash-verified

468}
469
470async function readConfigFile(target: string): Promise<PersistedConfig | null> {
471 try {
472 const raw = await fs.readFile(target, 'utf8')
473 const trimmed = raw.trim()
474 if (!trimmed) return null
475 return normalizePersistedConfig(JSON.parse(trimmed))
476 } catch (err) {
477 if (isMissingFileError(err)) return null
478 throw err
479 }
480}
481
482/** Internal: reads the persisted config and reports whether the bytes on
483 * disk were actually readable. Distinguishes three states:

Callers 1

loadConfigSafelyFunction · 0.70

Calls 2

normalizePersistedConfigFunction · 0.85
isMissingFileErrorFunction · 0.70

Tested by

no test coverage detected