()
| 38 | } |
| 39 | |
| 40 | export 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 | |
| 52 | export function saveAccessConfig(config: AccessConfig): void { |
| 53 | writeFileSync(configPath(), JSON.stringify(config, null, 2), 'utf-8') |
no test coverage detected