MCPcopy Create free account
hub / github.com/arctic-cli/interface / loadSettings

Function loadSettings

packages/arctic/src/global/index.ts:36–46  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

34 let settingsCache: Settings | undefined
35
36 async function loadSettings(): Promise<Settings> {
37 if (settingsCache) return settingsCache
38 const file = Bun.file(settingsFile)
39 const exists = await file.exists()
40 if (!exists) {
41 settingsCache = {}
42 return settingsCache
43 }
44 settingsCache = await file.json().catch(() => ({}))
45 return settingsCache!
46 }
47
48 async function saveSettings(settings: Settings): Promise<void> {
49 settingsCache = settings

Callers 7

getTelemetryEnabledFunction · 0.85
setTelemetryEnabledFunction · 0.85
getDeviceIdFunction · 0.85
getLastHeartbeatDateFunction · 0.85
setLastHeartbeatDateFunction · 0.85

Calls 2

jsonMethod · 0.65
existsMethod · 0.45

Tested by

no test coverage detected