src/util.js
function changeConfig(oldConfig, newConfig) {
  invariant(isObject(oldConfig), 'Old config is not valid');
  invariant(isObject(newConfig), 'Config is not valid');

  if (newConfig.host) {
    var host = newConfig.host;
    var prefix = '';

    if (host.indexOf('http://') < 0 && host.indexOf('https://') < 0) {
      prefix += 'http://';
    }

    oldConfig.host = prefix + newConfig.host;
  }

  if (newConfig.port) {
    oldConfig.port = newConfig.port;
  }
}
function changeConfig(oldConfig, newConfig) {
  invariant(isObject(oldConfig), 'Old config is not valid');
  invariant(isObject(newConfig), 'Config is not valid');

  if (newConfig.host) {
    var host = newConfig.host;
    var prefix = '';

    if (host.indexOf('http://') < 0 && host.indexOf('https://') < 0) {
      prefix += 'http://';
    }

    oldConfig.host = prefix + newConfig.host;
  }

  if (newConfig.port) {
    oldConfig.port = newConfig.port;
  }
}
function changeConfig ( oldConfig , newConfig ) { invariant ( isObject ( oldConfig ) , 'Old config is not valid' ) ; invariant ( isObject ( newConfig ) , 'Config is not valid' ) ; if ( newConfig . host ) { var host = newConfig . host ; var prefix = '' ; if ( host . indexOf ( 'http://' ) < 0 && host . indexOf ( 'https://' ) < 0 ) { prefix += 'http://' ; } oldConfig . host = prefix + newConfig . host ; } if ( newConfig . port ) { oldConfig . port = newConfig . port ; } }
Updates a config object
@param  {Object}  oldConfig  Old configuration object
@param  {Object}  newConfig  New configuration object
@return {Undefined}
Updates a config object