function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
export function mergeWith(obj, source, customizer) {
  if (typeof customizer !== 'function') {
    throw new Error('Customizer must be a function');
  }
  if (!isObject(obj) || !isObject(source)) {
    return obj;
  }
  for (var key in source) {
    if (Object.prototype.hasOwnProperty.call(source, key)) {
      var objValue = obj[key];
      var srcValue = source[key];
      var customValue = customizer(objValue, srcValue, key, obj, source);

      // 如果自定义方法返回 `undefined`，使用默认合并逻辑
      if (customValue === undefined) {
        if (isObject(objValue) && isObject(srcValue)) {
          obj[key] = mergeWith(objValue, srcValue, customizer);
        } else {
          obj[key] = srcValue;
        }
      } else {
        obj[key] = customValue;
      }
    }
  }
  return obj;
}
function isObject(value) {
  return value && _typeof(value) === 'object' && !Array.isArray(value);
}