"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
exports.__esModule = true;
exports["default"] = loadMethods;
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
var _isPlainObject = _interopRequireDefault(require("lodash/isPlainObject"));
var _excluded = ["init"];
function loadMethods(target, source) {
  if (!source || !(0, _isPlainObject["default"])(source)) {
    return;
  }
  var init = source.init,
    srcMethods = (0, _objectWithoutPropertiesLoose2["default"])(source, _excluded);

  // eslint-disable-next-line guard-for-in,no-restricted-syntax
  for (var methodName in srcMethods) {
    target[methodName] = source[methodName];
  }
  if (typeof init === 'function') {
    init.call(target);
  }
}