MCPcopy
hub / github.com/claude-code-best/claude-code / loadAccessConfig

Function loadAccessConfig

packages/weixin/src/pairing.ts:40–50  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

38}
39
40export function loadAccessConfig(): AccessConfig {
41 const path = configPath()
42 if (!existsSync(path)) {
43 return { policy: 'pairing', allowFrom: [] }
44 }
45 try {
46 return JSON.parse(readFileSync(path, 'utf-8')) as AccessConfig
47 } catch {
48 return { policy: 'pairing', allowFrom: [] }
49 }
50}
51
52export function saveAccessConfig(config: AccessConfig): void {
53 writeFileSync(configPath(), JSON.stringify(config, null, 2), 'utf-8')

Callers 3

isAllowedFunction · 0.85
confirmPairingFunction · 0.85
pairing.test.tsFile · 0.85

Calls 3

configPathFunction · 0.85
existsSyncFunction · 0.85
readFileSyncFunction · 0.50

Tested by

no test coverage detected