text: var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
  
  import arrayEach from 'fast-loops/lib/arrayEach';
  
  var basicStatics = {
    name: true,
    length: true,
    prototype: true,
    caller: true,
    callee: true,
    arguments: true,
    arity: true
  };
  
  var mergableStatics = ['contextTypes', 'defaultProps'];
  var blockedStatics = { childContextTypes: true, propTypes: true };
  
  export default function hoistStatics(target, source) {
    if (typeof source === 'string') {
      return target;
    }
  
    var statics = Object.getOwnPropertyNames(source).filter(function (property) {
      return !basicStatics[property];
    });
  
    arrayEach(statics, function (property) {
      if (!target.hasOwnProperty(property) && !blockedStatics[property]) {
        try {
          // Avoid failures from read-only properties
          var descriptor = Object.getOwnPropertyDescriptor(source, property);
          Object.defineProperty(target, property, descriptor);
        } catch (e) {}
      }
    });
  
    arrayEach(mergableStatics, function (property) {
      if (source[property]) {
        var targetStatics = target[property] || {};
  
        target[property] = _extends({}, source[property], targetStatics);
      }
    });
  
    return target;
  }