MCPcopy Create free account
hub / github.com/cortexkit/magic-context / mergeRawConfigs

Function mergeRawConfigs

packages/pi-plugin/src/config/index.ts:156–171  ·  view source on GitHub ↗
(
	base: Record<string, unknown>,
	override: Record<string, unknown>,
)

Source from the content-addressed store, hash-verified

154}
155
156function mergeRawConfigs(
157 base: Record<string, unknown>,
158 override: Record<string, unknown>,
159): Record<string, unknown> {
160 const merged: Record<string, unknown> = { ...base };
161
162 for (const [key, overrideValue] of Object.entries(override)) {
163 const baseValue = merged[key];
164 merged[key] =
165 isPlainObject(baseValue) && isPlainObject(overrideValue)
166 ? mergeRawConfigs(baseValue, overrideValue)
167 : overrideValue;
168 }
169
170 return merged;
171}
172
173function parsePiConfig(
174 rawConfig: Record<string, unknown>,

Callers 2

loadPiConfigFunction · 0.85
loadPiConfigDetailedFunction · 0.85

Calls 1

isPlainObjectFunction · 0.70

Tested by

no test coverage detected