MCPcopy Index your code
hub / github.com/codeaashu/claude-code / mergePluginSettings

Function mergePluginSettings

src/utils/plugins/pluginLoader.ts:3250–3275  ·  view source on GitHub ↗

* Merge settings from all enabled plugins into a single record. * Later plugins override earlier ones for the same key. * Only allowlisted keys are included (filtering happens at load time).

(
  plugins: LoadedPlugin[],
)

Source from the content-addressed store, hash-verified

3248 * Only allowlisted keys are included (filtering happens at load time).
3249 */
3250function mergePluginSettings(
3251 plugins: LoadedPlugin[],
3252): Record<string, unknown> | undefined {
3253 let merged: Record<string, unknown> | undefined
3254
3255 for (const plugin of plugins) {
3256 if (!plugin.settings) {
3257 continue
3258 }
3259
3260 if (!merged) {
3261 merged = {}
3262 }
3263
3264 for (const [key, value] of Object.entries(plugin.settings)) {
3265 if (key in merged) {
3266 logForDebugging(
3267 `Plugin "${plugin.name}" overrides setting "${key}" (previously set by another plugin)`,
3268 )
3269 }
3270 merged[key] = value
3271 }
3272 }
3273
3274 return merged
3275}
3276
3277/**
3278 * Store merged plugin settings in the synchronous cache.

Callers 1

cachePluginSettingsFunction · 0.85

Calls 2

logForDebuggingFunction · 0.85
entriesMethod · 0.80

Tested by

no test coverage detected