@xchainjs/xchain-aggregator 2.2.2 → 2.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/lib/index.esm.js +123 -101
  2. package/lib/index.js +123 -101
  3. package/package.json +16 -16
package/lib/index.esm.js CHANGED
@@ -1179,7 +1179,7 @@ var utils$1 = {
1179
1179
  isIterable,
1180
1180
  };
1181
1181
 
1182
- class AxiosError extends Error {
1182
+ let AxiosError$1 = class AxiosError extends Error {
1183
1183
  static from(error, code, config, request, response, customProps) {
1184
1184
  const axiosError = new AxiosError(error.message, code || error.code, config, request, response);
1185
1185
  axiosError.cause = error;
@@ -1231,21 +1231,21 @@ class AxiosError extends Error {
1231
1231
  status: this.status,
1232
1232
  };
1233
1233
  }
1234
- }
1234
+ };
1235
1235
 
1236
1236
  // This can be changed to static properties as soon as the parser options in .eslint.cjs are updated.
1237
- AxiosError.ERR_BAD_OPTION_VALUE = 'ERR_BAD_OPTION_VALUE';
1238
- AxiosError.ERR_BAD_OPTION = 'ERR_BAD_OPTION';
1239
- AxiosError.ECONNABORTED = 'ECONNABORTED';
1240
- AxiosError.ETIMEDOUT = 'ETIMEDOUT';
1241
- AxiosError.ERR_NETWORK = 'ERR_NETWORK';
1242
- AxiosError.ERR_FR_TOO_MANY_REDIRECTS = 'ERR_FR_TOO_MANY_REDIRECTS';
1243
- AxiosError.ERR_DEPRECATED = 'ERR_DEPRECATED';
1244
- AxiosError.ERR_BAD_RESPONSE = 'ERR_BAD_RESPONSE';
1245
- AxiosError.ERR_BAD_REQUEST = 'ERR_BAD_REQUEST';
1246
- AxiosError.ERR_CANCELED = 'ERR_CANCELED';
1247
- AxiosError.ERR_NOT_SUPPORT = 'ERR_NOT_SUPPORT';
1248
- AxiosError.ERR_INVALID_URL = 'ERR_INVALID_URL';
1237
+ AxiosError$1.ERR_BAD_OPTION_VALUE = 'ERR_BAD_OPTION_VALUE';
1238
+ AxiosError$1.ERR_BAD_OPTION = 'ERR_BAD_OPTION';
1239
+ AxiosError$1.ECONNABORTED = 'ECONNABORTED';
1240
+ AxiosError$1.ETIMEDOUT = 'ETIMEDOUT';
1241
+ AxiosError$1.ERR_NETWORK = 'ERR_NETWORK';
1242
+ AxiosError$1.ERR_FR_TOO_MANY_REDIRECTS = 'ERR_FR_TOO_MANY_REDIRECTS';
1243
+ AxiosError$1.ERR_DEPRECATED = 'ERR_DEPRECATED';
1244
+ AxiosError$1.ERR_BAD_RESPONSE = 'ERR_BAD_RESPONSE';
1245
+ AxiosError$1.ERR_BAD_REQUEST = 'ERR_BAD_REQUEST';
1246
+ AxiosError$1.ERR_CANCELED = 'ERR_CANCELED';
1247
+ AxiosError$1.ERR_NOT_SUPPORT = 'ERR_NOT_SUPPORT';
1248
+ AxiosError$1.ERR_INVALID_URL = 'ERR_INVALID_URL';
1249
1249
 
1250
1250
  // eslint-disable-next-line strict
1251
1251
  var httpAdapter = null;
@@ -1328,7 +1328,7 @@ const predicates = utils$1.toFlatObject(utils$1, {}, null, function filter(prop)
1328
1328
  *
1329
1329
  * @returns
1330
1330
  */
1331
- function toFormData(obj, formData, options) {
1331
+ function toFormData$1(obj, formData, options) {
1332
1332
  if (!utils$1.isObject(obj)) {
1333
1333
  throw new TypeError('target must be an object');
1334
1334
  }
@@ -1370,7 +1370,7 @@ function toFormData(obj, formData, options) {
1370
1370
  }
1371
1371
 
1372
1372
  if (!useBlob && utils$1.isBlob(value)) {
1373
- throw new AxiosError('Blob is not supported. Use a Buffer instead.');
1373
+ throw new AxiosError$1('Blob is not supported. Use a Buffer instead.');
1374
1374
  }
1375
1375
 
1376
1376
  if (utils$1.isArrayBuffer(value) || utils$1.isTypedArray(value)) {
@@ -1499,7 +1499,7 @@ function encode$1(str) {
1499
1499
  function AxiosURLSearchParams(params, options) {
1500
1500
  this._pairs = [];
1501
1501
 
1502
- params && toFormData(params, this, options);
1502
+ params && toFormData$1(params, this, options);
1503
1503
  }
1504
1504
 
1505
1505
  const prototype = AxiosURLSearchParams.prototype;
@@ -1727,7 +1727,7 @@ var platform = {
1727
1727
  };
1728
1728
 
1729
1729
  function toURLEncodedForm(data, options) {
1730
- return toFormData(data, new platform.classes.URLSearchParams(), {
1730
+ return toFormData$1(data, new platform.classes.URLSearchParams(), {
1731
1731
  visitor: function(value, key, path, helpers) {
1732
1732
  if (platform.isNode && utils$1.isBuffer(value)) {
1733
1733
  this.append(key, value.toString('base64'));
@@ -1852,7 +1852,7 @@ function stringifySafely(rawValue, parser, encoder) {
1852
1852
  }
1853
1853
  }
1854
1854
 
1855
- return (0, JSON.stringify)(rawValue);
1855
+ return (encoder || JSON.stringify)(rawValue);
1856
1856
  }
1857
1857
 
1858
1858
  const defaults = {
@@ -1903,7 +1903,7 @@ const defaults = {
1903
1903
  if ((isFileList = utils$1.isFileList(data)) || contentType.indexOf('multipart/form-data') > -1) {
1904
1904
  const _FormData = this.env && this.env.FormData;
1905
1905
 
1906
- return toFormData(
1906
+ return toFormData$1(
1907
1907
  isFileList ? {'files[]': data} : data,
1908
1908
  _FormData && new _FormData(),
1909
1909
  this.formSerializer
@@ -1937,7 +1937,7 @@ const defaults = {
1937
1937
  } catch (e) {
1938
1938
  if (strictJSONParsing) {
1939
1939
  if (e.name === 'SyntaxError') {
1940
- throw AxiosError.from(e, AxiosError.ERR_BAD_RESPONSE, this, null, this.response);
1940
+ throw AxiosError$1.from(e, AxiosError$1.ERR_BAD_RESPONSE, this, null, this.response);
1941
1941
  }
1942
1942
  throw e;
1943
1943
  }
@@ -2100,7 +2100,7 @@ function buildAccessors(obj, header) {
2100
2100
  });
2101
2101
  }
2102
2102
 
2103
- class AxiosHeaders {
2103
+ let AxiosHeaders$1 = class AxiosHeaders {
2104
2104
  constructor(headers) {
2105
2105
  headers && this.set(headers);
2106
2106
  }
@@ -2323,12 +2323,12 @@ class AxiosHeaders {
2323
2323
 
2324
2324
  return this;
2325
2325
  }
2326
- }
2326
+ };
2327
2327
 
2328
- AxiosHeaders.accessor(['Content-Type', 'Content-Length', 'Accept', 'Accept-Encoding', 'User-Agent', 'Authorization']);
2328
+ AxiosHeaders$1.accessor(['Content-Type', 'Content-Length', 'Accept', 'Accept-Encoding', 'User-Agent', 'Authorization']);
2329
2329
 
2330
2330
  // reserved names hotfix
2331
- utils$1.reduceDescriptors(AxiosHeaders.prototype, ({value}, key) => {
2331
+ utils$1.reduceDescriptors(AxiosHeaders$1.prototype, ({value}, key) => {
2332
2332
  let mapped = key[0].toUpperCase() + key.slice(1); // map `set` => `Set`
2333
2333
  return {
2334
2334
  get: () => value,
@@ -2338,7 +2338,7 @@ utils$1.reduceDescriptors(AxiosHeaders.prototype, ({value}, key) => {
2338
2338
  }
2339
2339
  });
2340
2340
 
2341
- utils$1.freezeMethods(AxiosHeaders);
2341
+ utils$1.freezeMethods(AxiosHeaders$1);
2342
2342
 
2343
2343
  /**
2344
2344
  * Transform the data for a request or a response
@@ -2351,7 +2351,7 @@ utils$1.freezeMethods(AxiosHeaders);
2351
2351
  function transformData(fns, response) {
2352
2352
  const config = this || defaults;
2353
2353
  const context = response || config;
2354
- const headers = AxiosHeaders.from(context.headers);
2354
+ const headers = AxiosHeaders$1.from(context.headers);
2355
2355
  let data = context.data;
2356
2356
 
2357
2357
  utils$1.forEach(fns, function transform(fn) {
@@ -2363,11 +2363,11 @@ function transformData(fns, response) {
2363
2363
  return data;
2364
2364
  }
2365
2365
 
2366
- function isCancel(value) {
2366
+ function isCancel$1(value) {
2367
2367
  return !!(value && value.__CANCEL__);
2368
2368
  }
2369
2369
 
2370
- class CanceledError extends AxiosError {
2370
+ let CanceledError$1 = class CanceledError extends AxiosError$1 {
2371
2371
  /**
2372
2372
  * A `CanceledError` is an object that is thrown when an operation is canceled.
2373
2373
  *
@@ -2378,11 +2378,11 @@ class CanceledError extends AxiosError {
2378
2378
  * @returns {CanceledError} The created error.
2379
2379
  */
2380
2380
  constructor(message, config, request) {
2381
- super(message == null ? 'canceled' : message, AxiosError.ERR_CANCELED, config, request);
2381
+ super(message == null ? 'canceled' : message, AxiosError$1.ERR_CANCELED, config, request);
2382
2382
  this.name = 'CanceledError';
2383
2383
  this.__CANCEL__ = true;
2384
2384
  }
2385
- }
2385
+ };
2386
2386
 
2387
2387
  /**
2388
2388
  * Resolve or reject a Promise based on response status.
@@ -2398,9 +2398,9 @@ function settle(resolve, reject, response) {
2398
2398
  if (!response.status || !validateStatus || validateStatus(response.status)) {
2399
2399
  resolve(response);
2400
2400
  } else {
2401
- reject(new AxiosError(
2401
+ reject(new AxiosError$1(
2402
2402
  'Request failed with status code ' + response.status,
2403
- [AxiosError.ERR_BAD_REQUEST, AxiosError.ERR_BAD_RESPONSE][Math.floor(response.status / 100) - 4],
2403
+ [AxiosError$1.ERR_BAD_REQUEST, AxiosError$1.ERR_BAD_RESPONSE][Math.floor(response.status / 100) - 4],
2404
2404
  response.config,
2405
2405
  response.request,
2406
2406
  response
@@ -2663,7 +2663,7 @@ function buildFullPath(baseURL, requestedURL, allowAbsoluteUrls) {
2663
2663
  }
2664
2664
 
2665
2665
  const headersToObject = (thing) =>
2666
- thing instanceof AxiosHeaders ? { ...thing } : thing;
2666
+ thing instanceof AxiosHeaders$1 ? { ...thing } : thing;
2667
2667
 
2668
2668
  /**
2669
2669
  * Config-specific merge-function which creates a new config-object
@@ -2674,7 +2674,7 @@ const headersToObject = (thing) =>
2674
2674
  *
2675
2675
  * @returns {Object} New object resulting from merging config2 to config1
2676
2676
  */
2677
- function mergeConfig(config1, config2) {
2677
+ function mergeConfig$1(config1, config2) {
2678
2678
  // eslint-disable-next-line no-param-reassign
2679
2679
  config2 = config2 || {};
2680
2680
  const config = {};
@@ -2778,11 +2778,11 @@ function mergeConfig(config1, config2) {
2778
2778
  }
2779
2779
 
2780
2780
  var resolveConfig = (config) => {
2781
- const newConfig = mergeConfig({}, config);
2781
+ const newConfig = mergeConfig$1({}, config);
2782
2782
 
2783
2783
  let { data, withXSRFToken, xsrfHeaderName, xsrfCookieName, headers, auth } = newConfig;
2784
2784
 
2785
- newConfig.headers = headers = AxiosHeaders.from(headers);
2785
+ newConfig.headers = headers = AxiosHeaders$1.from(headers);
2786
2786
 
2787
2787
  newConfig.url = buildURL(buildFullPath(newConfig.baseURL, newConfig.url, newConfig.allowAbsoluteUrls), config.params, config.paramsSerializer);
2788
2788
 
@@ -2835,7 +2835,7 @@ var xhrAdapter = isXHRAdapterSupported && function (config) {
2835
2835
  return new Promise(function dispatchXhrRequest(resolve, reject) {
2836
2836
  const _config = resolveConfig(config);
2837
2837
  let requestData = _config.data;
2838
- const requestHeaders = AxiosHeaders.from(_config.headers).normalize();
2838
+ const requestHeaders = AxiosHeaders$1.from(_config.headers).normalize();
2839
2839
  let {responseType, onUploadProgress, onDownloadProgress} = _config;
2840
2840
  let onCanceled;
2841
2841
  let uploadThrottled, downloadThrottled;
@@ -2862,7 +2862,7 @@ var xhrAdapter = isXHRAdapterSupported && function (config) {
2862
2862
  return;
2863
2863
  }
2864
2864
  // Prepare the response
2865
- const responseHeaders = AxiosHeaders.from(
2865
+ const responseHeaders = AxiosHeaders$1.from(
2866
2866
  'getAllResponseHeaders' in request && request.getAllResponseHeaders()
2867
2867
  );
2868
2868
  const responseData = !responseType || responseType === 'text' || responseType === 'json' ?
@@ -2917,7 +2917,7 @@ var xhrAdapter = isXHRAdapterSupported && function (config) {
2917
2917
  return;
2918
2918
  }
2919
2919
 
2920
- reject(new AxiosError('Request aborted', AxiosError.ECONNABORTED, config, request));
2920
+ reject(new AxiosError$1('Request aborted', AxiosError$1.ECONNABORTED, config, request));
2921
2921
 
2922
2922
  // Clean up request
2923
2923
  request = null;
@@ -2929,7 +2929,7 @@ var xhrAdapter = isXHRAdapterSupported && function (config) {
2929
2929
  // (message may be empty; when present, surface it)
2930
2930
  // See https://developer.mozilla.org/docs/Web/API/XMLHttpRequest/error_event
2931
2931
  const msg = event && event.message ? event.message : 'Network Error';
2932
- const err = new AxiosError(msg, AxiosError.ERR_NETWORK, config, request);
2932
+ const err = new AxiosError$1(msg, AxiosError$1.ERR_NETWORK, config, request);
2933
2933
  // attach the underlying event for consumers who want details
2934
2934
  err.event = event || null;
2935
2935
  reject(err);
@@ -2943,9 +2943,9 @@ var xhrAdapter = isXHRAdapterSupported && function (config) {
2943
2943
  if (_config.timeoutErrorMessage) {
2944
2944
  timeoutErrorMessage = _config.timeoutErrorMessage;
2945
2945
  }
2946
- reject(new AxiosError(
2946
+ reject(new AxiosError$1(
2947
2947
  timeoutErrorMessage,
2948
- transitional.clarifyTimeoutError ? AxiosError.ETIMEDOUT : AxiosError.ECONNABORTED,
2948
+ transitional.clarifyTimeoutError ? AxiosError$1.ETIMEDOUT : AxiosError$1.ECONNABORTED,
2949
2949
  config,
2950
2950
  request));
2951
2951
 
@@ -2995,7 +2995,7 @@ var xhrAdapter = isXHRAdapterSupported && function (config) {
2995
2995
  if (!request) {
2996
2996
  return;
2997
2997
  }
2998
- reject(!cancel || cancel.type ? new CanceledError(null, config, request) : cancel);
2998
+ reject(!cancel || cancel.type ? new CanceledError$1(null, config, request) : cancel);
2999
2999
  request.abort();
3000
3000
  request = null;
3001
3001
  };
@@ -3009,7 +3009,7 @@ var xhrAdapter = isXHRAdapterSupported && function (config) {
3009
3009
  const protocol = parseProtocol(_config.url);
3010
3010
 
3011
3011
  if (protocol && platform.protocols.indexOf(protocol) === -1) {
3012
- reject(new AxiosError('Unsupported protocol ' + protocol + ':', AxiosError.ERR_BAD_REQUEST, config));
3012
+ reject(new AxiosError$1('Unsupported protocol ' + protocol + ':', AxiosError$1.ERR_BAD_REQUEST, config));
3013
3013
  return;
3014
3014
  }
3015
3015
 
@@ -3032,13 +3032,13 @@ const composeSignals = (signals, timeout) => {
3032
3032
  aborted = true;
3033
3033
  unsubscribe();
3034
3034
  const err = reason instanceof Error ? reason : this.reason;
3035
- controller.abort(err instanceof AxiosError ? err : new CanceledError(err instanceof Error ? err.message : err));
3035
+ controller.abort(err instanceof AxiosError$1 ? err : new CanceledError$1(err instanceof Error ? err.message : err));
3036
3036
  }
3037
3037
  };
3038
3038
 
3039
3039
  let timer = timeout && setTimeout(() => {
3040
3040
  timer = null;
3041
- onabort(new AxiosError(`timeout of ${timeout}ms exceeded`, AxiosError.ETIMEDOUT));
3041
+ onabort(new AxiosError$1(`timeout of ${timeout}ms exceeded`, AxiosError$1.ETIMEDOUT));
3042
3042
  }, timeout);
3043
3043
 
3044
3044
  const unsubscribe = () => {
@@ -3222,7 +3222,7 @@ const factory = (env) => {
3222
3222
  return method.call(res);
3223
3223
  }
3224
3224
 
3225
- throw new AxiosError(`Response type '${type}' is not supported`, AxiosError.ERR_NOT_SUPPORT, config);
3225
+ throw new AxiosError$1(`Response type '${type}' is not supported`, AxiosError$1.ERR_NOT_SUPPORT, config);
3226
3226
  });
3227
3227
  });
3228
3228
  })());
@@ -3376,7 +3376,7 @@ const factory = (env) => {
3376
3376
  return await new Promise((resolve, reject) => {
3377
3377
  settle(resolve, reject, {
3378
3378
  data: responseData,
3379
- headers: AxiosHeaders.from(response.headers),
3379
+ headers: AxiosHeaders$1.from(response.headers),
3380
3380
  status: response.status,
3381
3381
  statusText: response.statusText,
3382
3382
  config,
@@ -3388,14 +3388,14 @@ const factory = (env) => {
3388
3388
 
3389
3389
  if (err && err.name === 'TypeError' && /Load failed|fetch/i.test(err.message)) {
3390
3390
  throw Object.assign(
3391
- new AxiosError('Network Error', AxiosError.ERR_NETWORK, config, request, err && err.response),
3391
+ new AxiosError$1('Network Error', AxiosError$1.ERR_NETWORK, config, request, err && err.response),
3392
3392
  {
3393
3393
  cause: err.cause || err
3394
3394
  }
3395
3395
  )
3396
3396
  }
3397
3397
 
3398
- throw AxiosError.from(err, err && err.code, config, request, err && err.response);
3398
+ throw AxiosError$1.from(err, err && err.code, config, request, err && err.response);
3399
3399
  }
3400
3400
  }
3401
3401
  };
@@ -3481,7 +3481,7 @@ const isResolvedHandle = (adapter) => utils$1.isFunction(adapter) || adapter ===
3481
3481
  * @throws {AxiosError} If no suitable adapter is available
3482
3482
  * @returns {Function} The resolved adapter function
3483
3483
  */
3484
- function getAdapter(adapters, config) {
3484
+ function getAdapter$1(adapters, config) {
3485
3485
  adapters = utils$1.isArray(adapters) ? adapters : [adapters];
3486
3486
 
3487
3487
  const { length } = adapters;
@@ -3500,7 +3500,7 @@ function getAdapter(adapters, config) {
3500
3500
  adapter = knownAdapters[(id = String(nameOrAdapter)).toLowerCase()];
3501
3501
 
3502
3502
  if (adapter === undefined) {
3503
- throw new AxiosError(`Unknown adapter '${id}'`);
3503
+ throw new AxiosError$1(`Unknown adapter '${id}'`);
3504
3504
  }
3505
3505
  }
3506
3506
 
@@ -3521,7 +3521,7 @@ function getAdapter(adapters, config) {
3521
3521
  (reasons.length > 1 ? 'since :\n' + reasons.map(renderReason).join('\n') : ' ' + renderReason(reasons[0])) :
3522
3522
  'as no adapter specified';
3523
3523
 
3524
- throw new AxiosError(
3524
+ throw new AxiosError$1(
3525
3525
  `There is no suitable adapter to dispatch the request ` + s,
3526
3526
  'ERR_NOT_SUPPORT'
3527
3527
  );
@@ -3538,7 +3538,7 @@ var adapters = {
3538
3538
  * Resolve an adapter from a list of adapter names or functions.
3539
3539
  * @type {Function}
3540
3540
  */
3541
- getAdapter,
3541
+ getAdapter: getAdapter$1,
3542
3542
 
3543
3543
  /**
3544
3544
  * Exposes all known adapters
@@ -3560,7 +3560,7 @@ function throwIfCancellationRequested(config) {
3560
3560
  }
3561
3561
 
3562
3562
  if (config.signal && config.signal.aborted) {
3563
- throw new CanceledError(null, config);
3563
+ throw new CanceledError$1(null, config);
3564
3564
  }
3565
3565
  }
3566
3566
 
@@ -3574,7 +3574,7 @@ function throwIfCancellationRequested(config) {
3574
3574
  function dispatchRequest(config) {
3575
3575
  throwIfCancellationRequested(config);
3576
3576
 
3577
- config.headers = AxiosHeaders.from(config.headers);
3577
+ config.headers = AxiosHeaders$1.from(config.headers);
3578
3578
 
3579
3579
  // Transform request data
3580
3580
  config.data = transformData.call(
@@ -3598,11 +3598,11 @@ function dispatchRequest(config) {
3598
3598
  response
3599
3599
  );
3600
3600
 
3601
- response.headers = AxiosHeaders.from(response.headers);
3601
+ response.headers = AxiosHeaders$1.from(response.headers);
3602
3602
 
3603
3603
  return response;
3604
3604
  }, function onAdapterRejection(reason) {
3605
- if (!isCancel(reason)) {
3605
+ if (!isCancel$1(reason)) {
3606
3606
  throwIfCancellationRequested(config);
3607
3607
 
3608
3608
  // Transform response data
@@ -3612,7 +3612,7 @@ function dispatchRequest(config) {
3612
3612
  config.transformResponse,
3613
3613
  reason.response
3614
3614
  );
3615
- reason.response.headers = AxiosHeaders.from(reason.response.headers);
3615
+ reason.response.headers = AxiosHeaders$1.from(reason.response.headers);
3616
3616
  }
3617
3617
  }
3618
3618
 
@@ -3620,7 +3620,7 @@ function dispatchRequest(config) {
3620
3620
  });
3621
3621
  }
3622
3622
 
3623
- const VERSION = "1.13.5";
3623
+ const VERSION$1 = "1.13.5";
3624
3624
 
3625
3625
  const validators$1 = {};
3626
3626
 
@@ -3644,15 +3644,15 @@ const deprecatedWarnings = {};
3644
3644
  */
3645
3645
  validators$1.transitional = function transitional(validator, version, message) {
3646
3646
  function formatMessage(opt, desc) {
3647
- return '[Axios v' + VERSION + '] Transitional option \'' + opt + '\'' + desc + (message ? '. ' + message : '');
3647
+ return '[Axios v' + VERSION$1 + '] Transitional option \'' + opt + '\'' + desc + (message ? '. ' + message : '');
3648
3648
  }
3649
3649
 
3650
3650
  // eslint-disable-next-line func-names
3651
3651
  return (value, opt, opts) => {
3652
3652
  if (validator === false) {
3653
- throw new AxiosError(
3653
+ throw new AxiosError$1(
3654
3654
  formatMessage(opt, ' has been removed' + (version ? ' in ' + version : '')),
3655
- AxiosError.ERR_DEPRECATED
3655
+ AxiosError$1.ERR_DEPRECATED
3656
3656
  );
3657
3657
  }
3658
3658
 
@@ -3691,7 +3691,7 @@ validators$1.spelling = function spelling(correctSpelling) {
3691
3691
 
3692
3692
  function assertOptions(options, schema, allowUnknown) {
3693
3693
  if (typeof options !== 'object') {
3694
- throw new AxiosError('options must be an object', AxiosError.ERR_BAD_OPTION_VALUE);
3694
+ throw new AxiosError$1('options must be an object', AxiosError$1.ERR_BAD_OPTION_VALUE);
3695
3695
  }
3696
3696
  const keys = Object.keys(options);
3697
3697
  let i = keys.length;
@@ -3702,12 +3702,12 @@ function assertOptions(options, schema, allowUnknown) {
3702
3702
  const value = options[opt];
3703
3703
  const result = value === undefined || validator(value, opt, options);
3704
3704
  if (result !== true) {
3705
- throw new AxiosError('option ' + opt + ' must be ' + result, AxiosError.ERR_BAD_OPTION_VALUE);
3705
+ throw new AxiosError$1('option ' + opt + ' must be ' + result, AxiosError$1.ERR_BAD_OPTION_VALUE);
3706
3706
  }
3707
3707
  continue;
3708
3708
  }
3709
3709
  if (allowUnknown !== true) {
3710
- throw new AxiosError('Unknown option ' + opt, AxiosError.ERR_BAD_OPTION);
3710
+ throw new AxiosError$1('Unknown option ' + opt, AxiosError$1.ERR_BAD_OPTION);
3711
3711
  }
3712
3712
  }
3713
3713
  }
@@ -3726,7 +3726,7 @@ const validators = validator.validators;
3726
3726
  *
3727
3727
  * @return {Axios} A new instance of Axios
3728
3728
  */
3729
- class Axios {
3729
+ let Axios$1 = class Axios {
3730
3730
  constructor(instanceConfig) {
3731
3731
  this.defaults = instanceConfig || {};
3732
3732
  this.interceptors = {
@@ -3780,7 +3780,7 @@ class Axios {
3780
3780
  config = configOrUrl || {};
3781
3781
  }
3782
3782
 
3783
- config = mergeConfig(this.defaults, config);
3783
+ config = mergeConfig$1(this.defaults, config);
3784
3784
 
3785
3785
  const {transitional, paramsSerializer, headers} = config;
3786
3786
 
@@ -3834,7 +3834,7 @@ class Axios {
3834
3834
  }
3835
3835
  );
3836
3836
 
3837
- config.headers = AxiosHeaders.concat(contextHeaders, headers);
3837
+ config.headers = AxiosHeaders$1.concat(contextHeaders, headers);
3838
3838
 
3839
3839
  // filter out skipped interceptors
3840
3840
  const requestInterceptorChain = [];
@@ -3912,17 +3912,17 @@ class Axios {
3912
3912
  }
3913
3913
 
3914
3914
  getUri(config) {
3915
- config = mergeConfig(this.defaults, config);
3915
+ config = mergeConfig$1(this.defaults, config);
3916
3916
  const fullPath = buildFullPath(config.baseURL, config.url, config.allowAbsoluteUrls);
3917
3917
  return buildURL(fullPath, config.params, config.paramsSerializer);
3918
3918
  }
3919
- }
3919
+ };
3920
3920
 
3921
3921
  // Provide aliases for supported request methods
3922
3922
  utils$1.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {
3923
3923
  /*eslint func-names:0*/
3924
- Axios.prototype[method] = function(url, config) {
3925
- return this.request(mergeConfig(config || {}, {
3924
+ Axios$1.prototype[method] = function(url, config) {
3925
+ return this.request(mergeConfig$1(config || {}, {
3926
3926
  method,
3927
3927
  url,
3928
3928
  data: (config || {}).data
@@ -3935,7 +3935,7 @@ utils$1.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method)
3935
3935
 
3936
3936
  function generateHTTPMethod(isForm) {
3937
3937
  return function httpMethod(url, data, config) {
3938
- return this.request(mergeConfig(config || {}, {
3938
+ return this.request(mergeConfig$1(config || {}, {
3939
3939
  method,
3940
3940
  headers: isForm ? {
3941
3941
  'Content-Type': 'multipart/form-data'
@@ -3946,9 +3946,9 @@ utils$1.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method)
3946
3946
  };
3947
3947
  }
3948
3948
 
3949
- Axios.prototype[method] = generateHTTPMethod();
3949
+ Axios$1.prototype[method] = generateHTTPMethod();
3950
3950
 
3951
- Axios.prototype[method + 'Form'] = generateHTTPMethod(true);
3951
+ Axios$1.prototype[method + 'Form'] = generateHTTPMethod(true);
3952
3952
  });
3953
3953
 
3954
3954
  /**
@@ -3958,7 +3958,7 @@ utils$1.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method)
3958
3958
  *
3959
3959
  * @returns {CancelToken}
3960
3960
  */
3961
- class CancelToken {
3961
+ let CancelToken$1 = class CancelToken {
3962
3962
  constructor(executor) {
3963
3963
  if (typeof executor !== 'function') {
3964
3964
  throw new TypeError('executor must be a function.');
@@ -4006,7 +4006,7 @@ class CancelToken {
4006
4006
  return;
4007
4007
  }
4008
4008
 
4009
- token.reason = new CanceledError(message, config, request);
4009
+ token.reason = new CanceledError$1(message, config, request);
4010
4010
  resolvePromise(token.reason);
4011
4011
  });
4012
4012
  }
@@ -4079,7 +4079,7 @@ class CancelToken {
4079
4079
  cancel
4080
4080
  };
4081
4081
  }
4082
- }
4082
+ };
4083
4083
 
4084
4084
  /**
4085
4085
  * Syntactic sugar for invoking a function and expanding an array for arguments.
@@ -4102,7 +4102,7 @@ class CancelToken {
4102
4102
  *
4103
4103
  * @returns {Function}
4104
4104
  */
4105
- function spread(callback) {
4105
+ function spread$1(callback) {
4106
4106
  return function wrap(arr) {
4107
4107
  return callback.apply(null, arr);
4108
4108
  };
@@ -4115,11 +4115,11 @@ function spread(callback) {
4115
4115
  *
4116
4116
  * @returns {boolean} True if the payload is an error thrown by Axios, otherwise false
4117
4117
  */
4118
- function isAxiosError(payload) {
4118
+ function isAxiosError$1(payload) {
4119
4119
  return utils$1.isObject(payload) && (payload.isAxiosError === true);
4120
4120
  }
4121
4121
 
4122
- const HttpStatusCode = {
4122
+ const HttpStatusCode$1 = {
4123
4123
  Continue: 100,
4124
4124
  SwitchingProtocols: 101,
4125
4125
  Processing: 102,
@@ -4191,8 +4191,8 @@ const HttpStatusCode = {
4191
4191
  InvalidSslCertificate: 526,
4192
4192
  };
4193
4193
 
4194
- Object.entries(HttpStatusCode).forEach(([key, value]) => {
4195
- HttpStatusCode[value] = key;
4194
+ Object.entries(HttpStatusCode$1).forEach(([key, value]) => {
4195
+ HttpStatusCode$1[value] = key;
4196
4196
  });
4197
4197
 
4198
4198
  /**
@@ -4203,18 +4203,18 @@ Object.entries(HttpStatusCode).forEach(([key, value]) => {
4203
4203
  * @returns {Axios} A new instance of Axios
4204
4204
  */
4205
4205
  function createInstance(defaultConfig) {
4206
- const context = new Axios(defaultConfig);
4207
- const instance = bind(Axios.prototype.request, context);
4206
+ const context = new Axios$1(defaultConfig);
4207
+ const instance = bind(Axios$1.prototype.request, context);
4208
4208
 
4209
4209
  // Copy axios.prototype to instance
4210
- utils$1.extend(instance, Axios.prototype, context, {allOwnKeys: true});
4210
+ utils$1.extend(instance, Axios$1.prototype, context, {allOwnKeys: true});
4211
4211
 
4212
4212
  // Copy context to instance
4213
4213
  utils$1.extend(instance, context, null, {allOwnKeys: true});
4214
4214
 
4215
4215
  // Factory for creating new instances
4216
4216
  instance.create = function create(instanceConfig) {
4217
- return createInstance(mergeConfig(defaultConfig, instanceConfig));
4217
+ return createInstance(mergeConfig$1(defaultConfig, instanceConfig));
4218
4218
  };
4219
4219
 
4220
4220
  return instance;
@@ -4224,17 +4224,17 @@ function createInstance(defaultConfig) {
4224
4224
  const axios = createInstance(defaults);
4225
4225
 
4226
4226
  // Expose Axios class to allow class inheritance
4227
- axios.Axios = Axios;
4227
+ axios.Axios = Axios$1;
4228
4228
 
4229
4229
  // Expose Cancel & CancelToken
4230
- axios.CanceledError = CanceledError;
4231
- axios.CancelToken = CancelToken;
4232
- axios.isCancel = isCancel;
4233
- axios.VERSION = VERSION;
4234
- axios.toFormData = toFormData;
4230
+ axios.CanceledError = CanceledError$1;
4231
+ axios.CancelToken = CancelToken$1;
4232
+ axios.isCancel = isCancel$1;
4233
+ axios.VERSION = VERSION$1;
4234
+ axios.toFormData = toFormData$1;
4235
4235
 
4236
4236
  // Expose AxiosError class
4237
- axios.AxiosError = AxiosError;
4237
+ axios.AxiosError = AxiosError$1;
4238
4238
 
4239
4239
  // alias for CanceledError for backward compatibility
4240
4240
  axios.Cancel = axios.CanceledError;
@@ -4244,24 +4244,46 @@ axios.all = function all(promises) {
4244
4244
  return Promise.all(promises);
4245
4245
  };
4246
4246
 
4247
- axios.spread = spread;
4247
+ axios.spread = spread$1;
4248
4248
 
4249
4249
  // Expose isAxiosError
4250
- axios.isAxiosError = isAxiosError;
4250
+ axios.isAxiosError = isAxiosError$1;
4251
4251
 
4252
4252
  // Expose mergeConfig
4253
- axios.mergeConfig = mergeConfig;
4253
+ axios.mergeConfig = mergeConfig$1;
4254
4254
 
4255
- axios.AxiosHeaders = AxiosHeaders;
4255
+ axios.AxiosHeaders = AxiosHeaders$1;
4256
4256
 
4257
4257
  axios.formToJSON = thing => formDataToJSON(utils$1.isHTMLForm(thing) ? new FormData(thing) : thing);
4258
4258
 
4259
4259
  axios.getAdapter = adapters.getAdapter;
4260
4260
 
4261
- axios.HttpStatusCode = HttpStatusCode;
4261
+ axios.HttpStatusCode = HttpStatusCode$1;
4262
4262
 
4263
4263
  axios.default = axios;
4264
4264
 
4265
+ // This module is intended to unwrap Axios default export as named.
4266
+ // Keep top-level export same with static properties
4267
+ // so that it can keep same with es module or cjs
4268
+ const {
4269
+ Axios,
4270
+ AxiosError,
4271
+ CanceledError,
4272
+ isCancel,
4273
+ CancelToken,
4274
+ VERSION,
4275
+ all,
4276
+ Cancel,
4277
+ isAxiosError,
4278
+ spread,
4279
+ toFormData,
4280
+ AxiosHeaders,
4281
+ HttpStatusCode,
4282
+ formToJSON,
4283
+ getAdapter,
4284
+ mergeConfig
4285
+ } = axios;
4286
+
4265
4287
  /******************************************************************************
4266
4288
  Copyright (c) Microsoft Corporation.
4267
4289