function throwIfCancellationRequested(config) {
  if (config.cancelToken) {
    config.cancelToken.throwIfRequested();
  }

  if (config.signal && config.signal.aborted) {
    throw new CanceledError(null, config);
  }
}
Throws a `CanceledError` if cancellation has been requested.

@param {Object} config The config that is to be used for the request

@returns {void}