export function deepMergeObjects<T>(target: T, source: Partial<T>): T {
  const output = { ...target };
  for (const key in source) {
    if (
      source[key] &&
      typeof source[key] === "object" &&
      !Array.isArray(source[key])
    ) {
      output[key] = deepMergeObjects(
        (target as any)[key] || {},
        (source as any)[key]
      );
    } else {
      (output as any)[key] = source[key];
    }
  }
  return output;
}
