How to deep-merge multiple json configuration files
- Step 1Prepare the base and override configs — Identify the merge order: base config first, environment config second, user-local config last. Each successive config has higher priority for conflicting keys.
- Step 2Paste each config in priority order — Add each JSON object as a separate merge input. The tool processes them in order — first is lowest priority, last is highest priority for conflicting keys.
- Step 3Configure array merge strategy — Choose: replace (override arrays entirely), append (concatenate), or union (merge and deduplicate). For allowed-origins arrays, union is typically correct. For feature flag lists, replace is usually correct.
- Step 4Verify the merged output — Review the merged JSON to confirm all override values took effect and base values not overridden are preserved. Check nested objects are merged (not replaced) as expected.
Frequently asked questions
How do I implement deep merge in JavaScript/TypeScript?+
Use lodash.mergeWith for custom array handling: import { mergeWith } from 'lodash'; const merged = mergeWith({}, base, override, (objValue, srcValue) => Array.isArray(objValue) ? [...objValue, ...srcValue] : undefined). For simple deep merge without custom logic: structuredClone is not a deep merge; use lodash.merge(base, override).
What happens when both configs have an array for the same key?+
This depends on your chosen strategy. lodash.merge replaces entire arrays (last value wins). For union behavior, you need a custom merge function. This tool lets you preview all three strategies — replace, append, union — before choosing which to implement in code.
Are connection strings and API keys in the config transmitted to JAD Apps?+
No. Merging runs entirely in your browser. Configuration objects including connection strings and API keys are never transmitted to JAD Apps servers.
Privacy first
Conversion runs locally in your browser. No file is uploaded — only metadata counters are saved for signed-in dashboard stats.