function deepMerge(target, ...sources) {
  if (!isObject(target)) return target;
  target = deepClone(target);

  for (const source of sources) {
    if (isObject(source)) {
      for (const key in source) {
        if (isObject(source[key])) {
          if (!(key in target)) target[key] = {};
          target[key] = deepMerge(target[key], source[key]);
        } else if (source[key] !== undefined) {
          target[key] = deepClone(source[key]);
        }
      }
    }
  }

  return target;
}
Deep merge two objects.

@template T
@param {T} target
@param sources
@returns {T}