es6/api/backups/client/index.js
/**
 * Wraps the client functions with connectOptions so defaults can be applied
 * @param {object} connectOptions Options that were supplied to the connect function.
 * @param {function} clientMethod The client method to be called.
 * @param {string} path The path this request i.e. /db/query.
 * @param {object} options Options for this request that will me merged with connectOptions.
 */
Wraps the client functions with connectOptions so defaults can be applied
@param {object} connectOptions Options that were supplied to the connect function.
@param {function} clientMethod The client method to be called.
@param {string} path The path this request i.e. /db/query.
@param {object} options Options for this request that will me merged with connectOptions.
Wraps the client functions with connectOptions so defaults can be applied @param { object } connectOptions Options that were supplied to the connect function . @param { function } clientMethod The client method to be called . @param { string } path The path this request i . e . / db / query . @param { object } options Options for this request that will me merged with connectOptions .
function clientConnect(connectOptions, clientMethod, options = {}) {
  const { url } = connectOptions
  if (!_isString(url)) {
    throw new Error('The url argument is required to be a string.')
  }
  if (!_isFunction(clientMethod)) {
    throw new Error('The clientMethod argument is required to be a function.')
  }
  const opts = _merge({}, _omit(connectOptions, ['url']), options)
  return clientMethod(url, opts)
}
function clientConnect ( connectOptions , clientMethod , options = { } ) { const { url } = connectOptions if ( ! _isString ( url ) ) { throw new Error ( 'The url argument is required to be a string.' ) } if ( ! _isFunction ( clientMethod ) ) { throw new Error ( 'The clientMethod argument is required to be a function.' ) } const opts = _merge ( { } , _omit ( connectOptions , [ 'url' ] ) , options ) return clientMethod ( url , opts ) }
Wraps the client functions with connectOptions so defaults can be applied
 @param {object} connectOptions Options that were supplied to the connect function.
Wraps the client functions with connectOptions so defaults can be applied @param { object } connectOptions Options that were supplied to the connect function .