function mergeConfig(a, b) {
	/** @type {any} */
	const merged = { ...a };

	for (const key in b) {
		const value = b[key];
		if (value == null) {
			continue;
		}

		const existing = merged[key];
		if (Array.isArray(existing) && Array.isArray(value)) {
			merged[key] = [...existing, ...value];
		} else if (existing !== null && typeof existing === 'object' && typeof value === 'object') {
			merged[key] = mergeConfig(existing, value);
		} else {
			merged[key] = value;
		}
	}

	return merged;
}
Deeply merge two config objects
@template {Record<string, any>} T
@template {Record<string, any>} U
@param {T} a
@param {U} b
@returns {T & U}