lib/connection.js
function createInternalConnection (mode) {

  var result;

  switch (mode) {
    case 'async':
      result = require('then-request');
      break;
    case 'sync':
      result = require('sync-req');
      break;
    default:
      throw new Error('Expected options.mode to be "async" or "sync" but got ' + JSON.stringify(mode));
  }

  return result;
}
function createInternalConnection (mode) {

  var result;

  switch (mode) {
    case 'async':
      result = require('then-request');
      break;
    case 'sync':
      result = require('sync-req');
      break;
    default:
      throw new Error('Expected options.mode to be "async" or "sync" but got ' + JSON.stringify(mode));
  }

  return result;
}
function createInternalConnection ( mode ) { var result ; switch ( mode ) { case 'async' : result = require ( 'then-request' ) ; break ; case 'sync' : result = require ( 'sync-req' ) ; break ; default : throw new Error ( 'Expected options.mode to be "async" or "sync" but got ' + JSON . stringify ( mode ) ) ; } return result ; }
Create connection object according to mode-type

@param {String} mode (async|sync)
@return {function}
Create connection object according to mode - type