export function mergeConfig(defaultUi: T, config: Partial): T { const mergedUi = {...defaultUi}; for (const key in config) { if (Object.prototype.hasOwnProperty.call(config, key)) { const defaultValue = defaultUi[key]; const configValue = config[key]; if (typeof defaultValue === 'object' && typeof configValue === 'object' && defaultValue !== null && configValue !== null) { mergedUi[key] = mergeConfig(defaultValue, configValue); } else if (typeof configValue === 'string') { mergedUi[key] = `${defaultValue} ${configValue}`; } else { mergedUi[key] = configValue; } } } return mergedUi as T; }