MCPcopy Index your code
hub / github.com/ChatLab/ChatLab / loadConfig

Function loadConfig

packages/config/src/loader.ts:23–29  ·  view source on GitHub ↗
(overrides?: Partial<ChatLabConfig>)

Source from the content-addressed store, hash-verified

21 * 加载完整配置
22 */
23export function loadConfig(overrides?: Partial<ChatLabConfig>): ChatLabConfig {
24 const fileConfig = loadConfigFile()
25 const envConfig = loadEnvConfig()
26
27 const merged = deepMerge(deepMerge(fileConfig, envConfig), overrides ?? {})
28 return configSchema.parse(merged)
29}
30
31/**
32 * 获取配置文件路径(返回实际存在的路径或默认 TOML 路径)

Callers 11

resolveUserDataDirFunction · 0.90
mainFunction · 0.90
getUserDataDirFunction · 0.90
needsUnifiedDirMigrationFunction · 0.90
migrateToUnifiedDirsFunction · 0.90
initLocaleFunction · 0.90
initMcpRuntimeFunction · 0.90
cli.tsFile · 0.90
initRuntimeFunction · 0.90
startHttpServerFunction · 0.90

Calls 4

loadConfigFileFunction · 0.85
loadEnvConfigFunction · 0.85
deepMergeFunction · 0.85
parseMethod · 0.80

Tested by

no test coverage detected