text: import { clone } from 'simple-cloning';
  import { isPrototypeOf } from 'core-helpers';
  import isObjectLike from 'lodash/isObjectLike';
  export function merge(value, forkedValue, options) {
      if (isObjectLike(value) && isObjectLike(forkedValue) && isPrototypeOf(value, forkedValue)) {
          return mergeObject(value, forkedValue, options);
      }
      if (typeof value === 'function' || typeof forkedValue === 'function') {
          throw new Error('Cannot merge a function');
      }
      return clone(forkedValue, options);
  }
  function mergeObject(object, forkedObject, options) {
      const objectMerger = options === null || options === void 0 ? void 0 : options.objectMerger;
      if (objectMerger !== undefined) {
          const mergedObject = objectMerger(object, forkedObject);
          if (mergedObject !== undefined) {
              return mergedObject;
          }
      }
      mergeAttributes(object, forkedObject, options);
      return object;
  }
  function mergeAttributes(object, forkedObject, options) {
      for (const [name, forkedValue] of Object.entries(forkedObject)) {
          const value = object[name];
          object[name] = merge(value, forkedValue, options);
      }
  }
  //# sourceMappingURL=merging.js.map