@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.js CHANGED
@@ -1181,7 +1181,7 @@ var utils$1 = {
1181
1181
  isIterable,
1182
1182
  };
1183
1183
 
1184
- class AxiosError extends Error {
1184
+ let AxiosError$1 = class AxiosError extends Error {
1185
1185
  static from(error, code, config, request, response, customProps) {
1186
1186
  const axiosError = new AxiosError(error.message, code || error.code, config, request, response);
1187
1187
  axiosError.cause = error;
@@ -1233,21 +1233,21 @@ class AxiosError extends Error {
1233
1233
  status: this.status,
1234
1234
  };
1235
1235
  }
1236
- }
1236
+ };
1237
1237
 
1238
1238
  // This can be changed to static properties as soon as the parser options in .eslint.cjs are updated.
1239
- AxiosError.ERR_BAD_OPTION_VALUE = 'ERR_BAD_OPTION_VALUE';
1240
- AxiosError.ERR_BAD_OPTION = 'ERR_BAD_OPTION';
1241
- AxiosError.ECONNABORTED = 'ECONNABORTED';
1242
- AxiosError.ETIMEDOUT = 'ETIMEDOUT';
1243
- AxiosError.ERR_NETWORK = 'ERR_NETWORK';
1244
- AxiosError.ERR_FR_TOO_MANY_REDIRECTS = 'ERR_FR_TOO_MANY_REDIRECTS';
1245
- AxiosError.ERR_DEPRECATED = 'ERR_DEPRECATED';
1246
- AxiosError.ERR_BAD_RESPONSE = 'ERR_BAD_RESPONSE';
1247
- AxiosError.ERR_BAD_REQUEST = 'ERR_BAD_REQUEST';
1248
- AxiosError.ERR_CANCELED = 'ERR_CANCELED';
1249
- AxiosError.ERR_NOT_SUPPORT = 'ERR_NOT_SUPPORT';
1250
- AxiosError.ERR_INVALID_URL = 'ERR_INVALID_URL';
1239
+ AxiosError$1.ERR_BAD_OPTION_VALUE = 'ERR_BAD_OPTION_VALUE';
1240
+ AxiosError$1.ERR_BAD_OPTION = 'ERR_BAD_OPTION';
1241
+ AxiosError$1.ECONNABORTED = 'ECONNABORTED';
1242
+ AxiosError$1.ETIMEDOUT = 'ETIMEDOUT';
1243
+ AxiosError$1.ERR_NETWORK = 'ERR_NETWORK';
1244
+ AxiosError$1.ERR_FR_TOO_MANY_REDIRECTS = 'ERR_FR_TOO_MANY_REDIRECTS';
1245
+ AxiosError$1.ERR_DEPRECATED = 'ERR_DEPRECATED';
1246
+ AxiosError$1.ERR_BAD_RESPONSE = 'ERR_BAD_RESPONSE';
1247
+ AxiosError$1.ERR_BAD_REQUEST = 'ERR_BAD_REQUEST';
1248
+ AxiosError$1.ERR_CANCELED = 'ERR_CANCELED';
1249
+ AxiosError$1.ERR_NOT_SUPPORT = 'ERR_NOT_SUPPORT';
1250
+ AxiosError$1.ERR_INVALID_URL = 'ERR_INVALID_URL';
1251
1251
 
1252
1252
  // eslint-disable-next-line strict
1253
1253
  var httpAdapter = null;
@@ -1330,7 +1330,7 @@ const predicates = utils$1.toFlatObject(utils$1, {}, null, function filter(prop)
1330
1330
  *
1331
1331
  * @returns
1332
1332
  */
1333
- function toFormData(obj, formData, options) {
1333
+ function toFormData$1(obj, formData, options) {
1334
1334
  if (!utils$1.isObject(obj)) {
1335
1335
  throw new TypeError('target must be an object');
1336
1336
  }
@@ -1372,7 +1372,7 @@ function toFormData(obj, formData, options) {
1372
1372
  }
1373
1373
 
1374
1374
  if (!useBlob && utils$1.isBlob(value)) {
1375
- throw new AxiosError('Blob is not supported. Use a Buffer instead.');
1375
+ throw new AxiosError$1('Blob is not supported. Use a Buffer instead.');
1376
1376
  }
1377
1377
 
1378
1378
  if (utils$1.isArrayBuffer(value) || utils$1.isTypedArray(value)) {
@@ -1501,7 +1501,7 @@ function encode$1(str) {
1501
1501
  function AxiosURLSearchParams(params, options) {
1502
1502
  this._pairs = [];
1503
1503
 
1504
- params && toFormData(params, this, options);
1504
+ params && toFormData$1(params, this, options);
1505
1505
  }
1506
1506
 
1507
1507
  const prototype = AxiosURLSearchParams.prototype;
@@ -1729,7 +1729,7 @@ var platform = {
1729
1729
  };
1730
1730
 
1731
1731
  function toURLEncodedForm(data, options) {
1732
- return toFormData(data, new platform.classes.URLSearchParams(), {
1732
+ return toFormData$1(data, new platform.classes.URLSearchParams(), {
1733
1733
  visitor: function(value, key, path, helpers) {
1734
1734
  if (platform.isNode && utils$1.isBuffer(value)) {
1735
1735
  this.append(key, value.toString('base64'));
@@ -1854,7 +1854,7 @@ function stringifySafely(rawValue, parser, encoder) {
1854
1854
  }
1855
1855
  }
1856
1856
 
1857
- return (0, JSON.stringify)(rawValue);
1857
+ return (encoder || JSON.stringify)(rawValue);
1858
1858
  }
1859
1859
 
1860
1860
  const defaults = {
@@ -1905,7 +1905,7 @@ const defaults = {
1905
1905
  if ((isFileList = utils$1.isFileList(data)) || contentType.indexOf('multipart/form-data') > -1) {
1906
1906
  const _FormData = this.env && this.env.FormData;
1907
1907
 
1908
- return toFormData(
1908
+ return toFormData$1(
1909
1909
  isFileList ? {'files[]': data} : data,
1910
1910
  _FormData && new _FormData(),
1911
1911
  this.formSerializer
@@ -1939,7 +1939,7 @@ const defaults = {
1939
1939
  } catch (e) {
1940
1940
  if (strictJSONParsing) {
1941
1941
  if (e.name === 'SyntaxError') {
1942
- throw AxiosError.from(e, AxiosError.ERR_BAD_RESPONSE, this, null, this.response);
1942
+ throw AxiosError$1.from(e, AxiosError$1.ERR_BAD_RESPONSE, this, null, this.response);
1943
1943
  }
1944
1944
  throw e;
1945
1945
  }
@@ -2102,7 +2102,7 @@ function buildAccessors(obj, header) {
2102
2102
  });
2103
2103
  }
2104
2104
 
2105
- class AxiosHeaders {
2105
+ let AxiosHeaders$1 = class AxiosHeaders {
2106
2106
  constructor(headers) {
2107
2107
  headers && this.set(headers);
2108
2108
  }
@@ -2325,12 +2325,12 @@ class AxiosHeaders {
2325
2325
 
2326
2326
  return this;
2327
2327
  }
2328
- }
2328
+ };
2329
2329
 
2330
- AxiosHeaders.accessor(['Content-Type', 'Content-Length', 'Accept', 'Accept-Encoding', 'User-Agent', 'Authorization']);
2330
+ AxiosHeaders$1.accessor(['Content-Type', 'Content-Length', 'Accept', 'Accept-Encoding', 'User-Agent', 'Authorization']);
2331
2331
 
2332
2332
  // reserved names hotfix
2333
- utils$1.reduceDescriptors(AxiosHeaders.prototype, ({value}, key) => {
2333
+ utils$1.reduceDescriptors(AxiosHeaders$1.prototype, ({value}, key) => {
2334
2334
  let mapped = key[0].toUpperCase() + key.slice(1); // map `set` => `Set`
2335
2335
  return {
2336
2336
  get: () => value,
@@ -2340,7 +2340,7 @@ utils$1.reduceDescriptors(AxiosHeaders.prototype, ({value}, key) => {
2340
2340
  }
2341
2341
  });
2342
2342
 
2343
- utils$1.freezeMethods(AxiosHeaders);
2343
+ utils$1.freezeMethods(AxiosHeaders$1);
2344
2344
 
2345
2345
  /**
2346
2346
  * Transform the data for a request or a response
@@ -2353,7 +2353,7 @@ utils$1.freezeMethods(AxiosHeaders);
2353
2353
  function transformData(fns, response) {
2354
2354
  const config = this || defaults;
2355
2355
  const context = response || config;
2356
- const headers = AxiosHeaders.from(context.headers);
2356
+ const headers = AxiosHeaders$1.from(context.headers);
2357
2357
  let data = context.data;
2358
2358
 
2359
2359
  utils$1.forEach(fns, function transform(fn) {
@@ -2365,11 +2365,11 @@ function transformData(fns, response) {
2365
2365
  return data;
2366
2366
  }
2367
2367
 
2368
- function isCancel(value) {
2368
+ function isCancel$1(value) {
2369
2369
  return !!(value && value.__CANCEL__);
2370
2370
  }
2371
2371
 
2372
- class CanceledError extends AxiosError {
2372
+ let CanceledError$1 = class CanceledError extends AxiosError$1 {
2373
2373
  /**
2374
2374
  * A `CanceledError` is an object that is thrown when an operation is canceled.
2375
2375
  *
@@ -2380,11 +2380,11 @@ class CanceledError extends AxiosError {
2380
2380
  * @returns {CanceledError} The created error.
2381
2381
  */
2382
2382
  constructor(message, config, request) {
2383
- super(message == null ? 'canceled' : message, AxiosError.ERR_CANCELED, config, request);
2383
+ super(message == null ? 'canceled' : message, AxiosError$1.ERR_CANCELED, config, request);
2384
2384
  this.name = 'CanceledError';
2385
2385
  this.__CANCEL__ = true;
2386
2386
  }
2387
- }
2387
+ };
2388
2388
 
2389
2389
  /**
2390
2390
  * Resolve or reject a Promise based on response status.
@@ -2400,9 +2400,9 @@ function settle(resolve, reject, response) {
2400
2400
  if (!response.status || !validateStatus || validateStatus(response.status)) {
2401
2401
  resolve(response);
2402
2402
  } else {
2403
- reject(new AxiosError(
2403
+ reject(new AxiosError$1(
2404
2404
  'Request failed with status code ' + response.status,
2405
- [AxiosError.ERR_BAD_REQUEST, AxiosError.ERR_BAD_RESPONSE][Math.floor(response.status / 100) - 4],
2405
+ [AxiosError$1.ERR_BAD_REQUEST, AxiosError$1.ERR_BAD_RESPONSE][Math.floor(response.status / 100) - 4],
2406
2406
  response.config,
2407
2407
  response.request,
2408
2408
  response
@@ -2665,7 +2665,7 @@ function buildFullPath(baseURL, requestedURL, allowAbsoluteUrls) {
2665
2665
  }
2666
2666
 
2667
2667
  const headersToObject = (thing) =>
2668
- thing instanceof AxiosHeaders ? { ...thing } : thing;
2668
+ thing instanceof AxiosHeaders$1 ? { ...thing } : thing;
2669
2669
 
2670
2670
  /**
2671
2671
  * Config-specific merge-function which creates a new config-object
@@ -2676,7 +2676,7 @@ const headersToObject = (thing) =>
2676
2676
  *
2677
2677
  * @returns {Object} New object resulting from merging config2 to config1
2678
2678
  */
2679
- function mergeConfig(config1, config2) {
2679
+ function mergeConfig$1(config1, config2) {
2680
2680
  // eslint-disable-next-line no-param-reassign
2681
2681
  config2 = config2 || {};
2682
2682
  const config = {};
@@ -2780,11 +2780,11 @@ function mergeConfig(config1, config2) {
2780
2780
  }
2781
2781
 
2782
2782
  var resolveConfig = (config) => {
2783
- const newConfig = mergeConfig({}, config);
2783
+ const newConfig = mergeConfig$1({}, config);
2784
2784
 
2785
2785
  let { data, withXSRFToken, xsrfHeaderName, xsrfCookieName, headers, auth } = newConfig;
2786
2786
 
2787
- newConfig.headers = headers = AxiosHeaders.from(headers);
2787
+ newConfig.headers = headers = AxiosHeaders$1.from(headers);
2788
2788
 
2789
2789
  newConfig.url = buildURL(buildFullPath(newConfig.baseURL, newConfig.url, newConfig.allowAbsoluteUrls), config.params, config.paramsSerializer);
2790
2790
 
@@ -2837,7 +2837,7 @@ var xhrAdapter = isXHRAdapterSupported && function (config) {
2837
2837
  return new Promise(function dispatchXhrRequest(resolve, reject) {
2838
2838
  const _config = resolveConfig(config);
2839
2839
  let requestData = _config.data;
2840
- const requestHeaders = AxiosHeaders.from(_config.headers).normalize();
2840
+ const requestHeaders = AxiosHeaders$1.from(_config.headers).normalize();
2841
2841
  let {responseType, onUploadProgress, onDownloadProgress} = _config;
2842
2842
  let onCanceled;
2843
2843
  let uploadThrottled, downloadThrottled;
@@ -2864,7 +2864,7 @@ var xhrAdapter = isXHRAdapterSupported && function (config) {
2864
2864
  return;
2865
2865
  }
2866
2866
  // Prepare the response
2867
- const responseHeaders = AxiosHeaders.from(
2867
+ const responseHeaders = AxiosHeaders$1.from(
2868
2868
  'getAllResponseHeaders' in request && request.getAllResponseHeaders()
2869
2869
  );
2870
2870
  const responseData = !responseType || responseType === 'text' || responseType === 'json' ?
@@ -2919,7 +2919,7 @@ var xhrAdapter = isXHRAdapterSupported && function (config) {
2919
2919
  return;
2920
2920
  }
2921
2921
 
2922
- reject(new AxiosError('Request aborted', AxiosError.ECONNABORTED, config, request));
2922
+ reject(new AxiosError$1('Request aborted', AxiosError$1.ECONNABORTED, config, request));
2923
2923
 
2924
2924
  // Clean up request
2925
2925
  request = null;
@@ -2931,7 +2931,7 @@ var xhrAdapter = isXHRAdapterSupported && function (config) {
2931
2931
  // (message may be empty; when present, surface it)
2932
2932
  // See https://developer.mozilla.org/docs/Web/API/XMLHttpRequest/error_event
2933
2933
  const msg = event && event.message ? event.message : 'Network Error';
2934
- const err = new AxiosError(msg, AxiosError.ERR_NETWORK, config, request);
2934
+ const err = new AxiosError$1(msg, AxiosError$1.ERR_NETWORK, config, request);
2935
2935
  // attach the underlying event for consumers who want details
2936
2936
  err.event = event || null;
2937
2937
  reject(err);
@@ -2945,9 +2945,9 @@ var xhrAdapter = isXHRAdapterSupported && function (config) {
2945
2945
  if (_config.timeoutErrorMessage) {
2946
2946
  timeoutErrorMessage = _config.timeoutErrorMessage;
2947
2947
  }
2948
- reject(new AxiosError(
2948
+ reject(new AxiosError$1(
2949
2949
  timeoutErrorMessage,
2950
- transitional.clarifyTimeoutError ? AxiosError.ETIMEDOUT : AxiosError.ECONNABORTED,
2950
+ transitional.clarifyTimeoutError ? AxiosError$1.ETIMEDOUT : AxiosError$1.ECONNABORTED,
2951
2951
  config,
2952
2952
  request));
2953
2953
 
@@ -2997,7 +2997,7 @@ var xhrAdapter = isXHRAdapterSupported && function (config) {
2997
2997
  if (!request) {
2998
2998
  return;
2999
2999
  }
3000
- reject(!cancel || cancel.type ? new CanceledError(null, config, request) : cancel);
3000
+ reject(!cancel || cancel.type ? new CanceledError$1(null, config, request) : cancel);
3001
3001
  request.abort();
3002
3002
  request = null;
3003
3003
  };
@@ -3011,7 +3011,7 @@ var xhrAdapter = isXHRAdapterSupported && function (config) {
3011
3011
  const protocol = parseProtocol(_config.url);
3012
3012
 
3013
3013
  if (protocol && platform.protocols.indexOf(protocol) === -1) {
3014
- reject(new AxiosError('Unsupported protocol ' + protocol + ':', AxiosError.ERR_BAD_REQUEST, config));
3014
+ reject(new AxiosError$1('Unsupported protocol ' + protocol + ':', AxiosError$1.ERR_BAD_REQUEST, config));
3015
3015
  return;
3016
3016
  }
3017
3017
 
@@ -3034,13 +3034,13 @@ const composeSignals = (signals, timeout) => {
3034
3034
  aborted = true;
3035
3035
  unsubscribe();
3036
3036
  const err = reason instanceof Error ? reason : this.reason;
3037
- controller.abort(err instanceof AxiosError ? err : new CanceledError(err instanceof Error ? err.message : err));
3037
+ controller.abort(err instanceof AxiosError$1 ? err : new CanceledError$1(err instanceof Error ? err.message : err));
3038
3038
  }
3039
3039
  };
3040
3040
 
3041
3041
  let timer = timeout && setTimeout(() => {
3042
3042
  timer = null;
3043
- onabort(new AxiosError(`timeout of ${timeout}ms exceeded`, AxiosError.ETIMEDOUT));
3043
+ onabort(new AxiosError$1(`timeout of ${timeout}ms exceeded`, AxiosError$1.ETIMEDOUT));
3044
3044
  }, timeout);
3045
3045
 
3046
3046
  const unsubscribe = () => {
@@ -3224,7 +3224,7 @@ const factory = (env) => {
3224
3224
  return method.call(res);
3225
3225
  }
3226
3226
 
3227
- throw new AxiosError(`Response type '${type}' is not supported`, AxiosError.ERR_NOT_SUPPORT, config);
3227
+ throw new AxiosError$1(`Response type '${type}' is not supported`, AxiosError$1.ERR_NOT_SUPPORT, config);
3228
3228
  });
3229
3229
  });
3230
3230
  })());
@@ -3378,7 +3378,7 @@ const factory = (env) => {
3378
3378
  return await new Promise((resolve, reject) => {
3379
3379
  settle(resolve, reject, {
3380
3380
  data: responseData,
3381
- headers: AxiosHeaders.from(response.headers),
3381
+ headers: AxiosHeaders$1.from(response.headers),
3382
3382
  status: response.status,
3383
3383
  statusText: response.statusText,
3384
3384
  config,
@@ -3390,14 +3390,14 @@ const factory = (env) => {
3390
3390
 
3391
3391
  if (err && err.name === 'TypeError' && /Load failed|fetch/i.test(err.message)) {
3392
3392
  throw Object.assign(
3393
- new AxiosError('Network Error', AxiosError.ERR_NETWORK, config, request, err && err.response),
3393
+ new AxiosError$1('Network Error', AxiosError$1.ERR_NETWORK, config, request, err && err.response),
3394
3394
  {
3395
3395
  cause: err.cause || err
3396
3396
  }
3397
3397
  )
3398
3398
  }
3399
3399
 
3400
- throw AxiosError.from(err, err && err.code, config, request, err && err.response);
3400
+ throw AxiosError$1.from(err, err && err.code, config, request, err && err.response);
3401
3401
  }
3402
3402
  }
3403
3403
  };
@@ -3483,7 +3483,7 @@ const isResolvedHandle = (adapter) => utils$1.isFunction(adapter) || adapter ===
3483
3483
  * @throws {AxiosError} If no suitable adapter is available
3484
3484
  * @returns {Function} The resolved adapter function
3485
3485
  */
3486
- function getAdapter(adapters, config) {
3486
+ function getAdapter$1(adapters, config) {
3487
3487
  adapters = utils$1.isArray(adapters) ? adapters : [adapters];
3488
3488
 
3489
3489
  const { length } = adapters;
@@ -3502,7 +3502,7 @@ function getAdapter(adapters, config) {
3502
3502
  adapter = knownAdapters[(id = String(nameOrAdapter)).toLowerCase()];
3503
3503
 
3504
3504
  if (adapter === undefined) {
3505
- throw new AxiosError(`Unknown adapter '${id}'`);
3505
+ throw new AxiosError$1(`Unknown adapter '${id}'`);
3506
3506
  }
3507
3507
  }
3508
3508
 
@@ -3523,7 +3523,7 @@ function getAdapter(adapters, config) {
3523
3523
  (reasons.length > 1 ? 'since :\n' + reasons.map(renderReason).join('\n') : ' ' + renderReason(reasons[0])) :
3524
3524
  'as no adapter specified';
3525
3525
 
3526
- throw new AxiosError(
3526
+ throw new AxiosError$1(
3527
3527
  `There is no suitable adapter to dispatch the request ` + s,
3528
3528
  'ERR_NOT_SUPPORT'
3529
3529
  );
@@ -3540,7 +3540,7 @@ var adapters = {
3540
3540
  * Resolve an adapter from a list of adapter names or functions.
3541
3541
  * @type {Function}
3542
3542
  */
3543
- getAdapter,
3543
+ getAdapter: getAdapter$1,
3544
3544
 
3545
3545
  /**
3546
3546
  * Exposes all known adapters
@@ -3562,7 +3562,7 @@ function throwIfCancellationRequested(config) {
3562
3562
  }
3563
3563
 
3564
3564
  if (config.signal && config.signal.aborted) {
3565
- throw new CanceledError(null, config);
3565
+ throw new CanceledError$1(null, config);
3566
3566
  }
3567
3567
  }
3568
3568
 
@@ -3576,7 +3576,7 @@ function throwIfCancellationRequested(config) {
3576
3576
  function dispatchRequest(config) {
3577
3577
  throwIfCancellationRequested(config);
3578
3578
 
3579
- config.headers = AxiosHeaders.from(config.headers);
3579
+ config.headers = AxiosHeaders$1.from(config.headers);
3580
3580
 
3581
3581
  // Transform request data
3582
3582
  config.data = transformData.call(
@@ -3600,11 +3600,11 @@ function dispatchRequest(config) {
3600
3600
  response
3601
3601
  );
3602
3602
 
3603
- response.headers = AxiosHeaders.from(response.headers);
3603
+ response.headers = AxiosHeaders$1.from(response.headers);
3604
3604
 
3605
3605
  return response;
3606
3606
  }, function onAdapterRejection(reason) {
3607
- if (!isCancel(reason)) {
3607
+ if (!isCancel$1(reason)) {
3608
3608
  throwIfCancellationRequested(config);
3609
3609
 
3610
3610
  // Transform response data
@@ -3614,7 +3614,7 @@ function dispatchRequest(config) {
3614
3614
  config.transformResponse,
3615
3615
  reason.response
3616
3616
  );
3617
- reason.response.headers = AxiosHeaders.from(reason.response.headers);
3617
+ reason.response.headers = AxiosHeaders$1.from(reason.response.headers);
3618
3618
  }
3619
3619
  }
3620
3620
 
@@ -3622,7 +3622,7 @@ function dispatchRequest(config) {
3622
3622
  });
3623
3623
  }
3624
3624
 
3625
- const VERSION = "1.13.5";
3625
+ const VERSION$1 = "1.13.5";
3626
3626
 
3627
3627
  const validators$1 = {};
3628
3628
 
@@ -3646,15 +3646,15 @@ const deprecatedWarnings = {};
3646
3646
  */
3647
3647
  validators$1.transitional = function transitional(validator, version, message) {
3648
3648
  function formatMessage(opt, desc) {
3649
- return '[Axios v' + VERSION + '] Transitional option \'' + opt + '\'' + desc + (message ? '. ' + message : '');
3649
+ return '[Axios v' + VERSION$1 + '] Transitional option \'' + opt + '\'' + desc + (message ? '. ' + message : '');
3650
3650
  }
3651
3651
 
3652
3652
  // eslint-disable-next-line func-names
3653
3653
  return (value, opt, opts) => {
3654
3654
  if (validator === false) {
3655
- throw new AxiosError(
3655
+ throw new AxiosError$1(
3656
3656
  formatMessage(opt, ' has been removed' + (version ? ' in ' + version : '')),
3657
- AxiosError.ERR_DEPRECATED
3657
+ AxiosError$1.ERR_DEPRECATED
3658
3658
  );
3659
3659
  }
3660
3660
 
@@ -3693,7 +3693,7 @@ validators$1.spelling = function spelling(correctSpelling) {
3693
3693
 
3694
3694
  function assertOptions(options, schema, allowUnknown) {
3695
3695
  if (typeof options !== 'object') {
3696
- throw new AxiosError('options must be an object', AxiosError.ERR_BAD_OPTION_VALUE);
3696
+ throw new AxiosError$1('options must be an object', AxiosError$1.ERR_BAD_OPTION_VALUE);
3697
3697
  }
3698
3698
  const keys = Object.keys(options);
3699
3699
  let i = keys.length;
@@ -3704,12 +3704,12 @@ function assertOptions(options, schema, allowUnknown) {
3704
3704
  const value = options[opt];
3705
3705
  const result = value === undefined || validator(value, opt, options);
3706
3706
  if (result !== true) {
3707
- throw new AxiosError('option ' + opt + ' must be ' + result, AxiosError.ERR_BAD_OPTION_VALUE);
3707
+ throw new AxiosError$1('option ' + opt + ' must be ' + result, AxiosError$1.ERR_BAD_OPTION_VALUE);
3708
3708
  }
3709
3709
  continue;
3710
3710
  }
3711
3711
  if (allowUnknown !== true) {
3712
- throw new AxiosError('Unknown option ' + opt, AxiosError.ERR_BAD_OPTION);
3712
+ throw new AxiosError$1('Unknown option ' + opt, AxiosError$1.ERR_BAD_OPTION);
3713
3713
  }
3714
3714
  }
3715
3715
  }
@@ -3728,7 +3728,7 @@ const validators = validator.validators;
3728
3728
  *
3729
3729
  * @return {Axios} A new instance of Axios
3730
3730
  */
3731
- class Axios {
3731
+ let Axios$1 = class Axios {
3732
3732
  constructor(instanceConfig) {
3733
3733
  this.defaults = instanceConfig || {};
3734
3734
  this.interceptors = {
@@ -3782,7 +3782,7 @@ class Axios {
3782
3782
  config = configOrUrl || {};
3783
3783
  }
3784
3784
 
3785
- config = mergeConfig(this.defaults, config);
3785
+ config = mergeConfig$1(this.defaults, config);
3786
3786
 
3787
3787
  const {transitional, paramsSerializer, headers} = config;
3788
3788
 
@@ -3836,7 +3836,7 @@ class Axios {
3836
3836
  }
3837
3837
  );
3838
3838
 
3839
- config.headers = AxiosHeaders.concat(contextHeaders, headers);
3839
+ config.headers = AxiosHeaders$1.concat(contextHeaders, headers);
3840
3840
 
3841
3841
  // filter out skipped interceptors
3842
3842
  const requestInterceptorChain = [];
@@ -3914,17 +3914,17 @@ class Axios {
3914
3914
  }
3915
3915
 
3916
3916
  getUri(config) {
3917
- config = mergeConfig(this.defaults, config);
3917
+ config = mergeConfig$1(this.defaults, config);
3918
3918
  const fullPath = buildFullPath(config.baseURL, config.url, config.allowAbsoluteUrls);
3919
3919
  return buildURL(fullPath, config.params, config.paramsSerializer);
3920
3920
  }
3921
- }
3921
+ };
3922
3922
 
3923
3923
  // Provide aliases for supported request methods
3924
3924
  utils$1.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {
3925
3925
  /*eslint func-names:0*/
3926
- Axios.prototype[method] = function(url, config) {
3927
- return this.request(mergeConfig(config || {}, {
3926
+ Axios$1.prototype[method] = function(url, config) {
3927
+ return this.request(mergeConfig$1(config || {}, {
3928
3928
  method,
3929
3929
  url,
3930
3930
  data: (config || {}).data
@@ -3937,7 +3937,7 @@ utils$1.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method)
3937
3937
 
3938
3938
  function generateHTTPMethod(isForm) {
3939
3939
  return function httpMethod(url, data, config) {
3940
- return this.request(mergeConfig(config || {}, {
3940
+ return this.request(mergeConfig$1(config || {}, {
3941
3941
  method,
3942
3942
  headers: isForm ? {
3943
3943
  'Content-Type': 'multipart/form-data'
@@ -3948,9 +3948,9 @@ utils$1.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method)
3948
3948
  };
3949
3949
  }
3950
3950
 
3951
- Axios.prototype[method] = generateHTTPMethod();
3951
+ Axios$1.prototype[method] = generateHTTPMethod();
3952
3952
 
3953
- Axios.prototype[method + 'Form'] = generateHTTPMethod(true);
3953
+ Axios$1.prototype[method + 'Form'] = generateHTTPMethod(true);
3954
3954
  });
3955
3955
 
3956
3956
  /**
@@ -3960,7 +3960,7 @@ utils$1.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method)
3960
3960
  *
3961
3961
  * @returns {CancelToken}
3962
3962
  */
3963
- class CancelToken {
3963
+ let CancelToken$1 = class CancelToken {
3964
3964
  constructor(executor) {
3965
3965
  if (typeof executor !== 'function') {
3966
3966
  throw new TypeError('executor must be a function.');
@@ -4008,7 +4008,7 @@ class CancelToken {
4008
4008
  return;
4009
4009
  }
4010
4010
 
4011
- token.reason = new CanceledError(message, config, request);
4011
+ token.reason = new CanceledError$1(message, config, request);
4012
4012
  resolvePromise(token.reason);
4013
4013
  });
4014
4014
  }
@@ -4081,7 +4081,7 @@ class CancelToken {
4081
4081
  cancel
4082
4082
  };
4083
4083
  }
4084
- }
4084
+ };
4085
4085
 
4086
4086
  /**
4087
4087
  * Syntactic sugar for invoking a function and expanding an array for arguments.
@@ -4104,7 +4104,7 @@ class CancelToken {
4104
4104
  *
4105
4105
  * @returns {Function}
4106
4106
  */
4107
- function spread(callback) {
4107
+ function spread$1(callback) {
4108
4108
  return function wrap(arr) {
4109
4109
  return callback.apply(null, arr);
4110
4110
  };
@@ -4117,11 +4117,11 @@ function spread(callback) {
4117
4117
  *
4118
4118
  * @returns {boolean} True if the payload is an error thrown by Axios, otherwise false
4119
4119
  */
4120
- function isAxiosError(payload) {
4120
+ function isAxiosError$1(payload) {
4121
4121
  return utils$1.isObject(payload) && (payload.isAxiosError === true);
4122
4122
  }
4123
4123
 
4124
- const HttpStatusCode = {
4124
+ const HttpStatusCode$1 = {
4125
4125
  Continue: 100,
4126
4126
  SwitchingProtocols: 101,
4127
4127
  Processing: 102,
@@ -4193,8 +4193,8 @@ const HttpStatusCode = {
4193
4193
  InvalidSslCertificate: 526,
4194
4194
  };
4195
4195
 
4196
- Object.entries(HttpStatusCode).forEach(([key, value]) => {
4197
- HttpStatusCode[value] = key;
4196
+ Object.entries(HttpStatusCode$1).forEach(([key, value]) => {
4197
+ HttpStatusCode$1[value] = key;
4198
4198
  });
4199
4199
 
4200
4200
  /**
@@ -4205,18 +4205,18 @@ Object.entries(HttpStatusCode).forEach(([key, value]) => {
4205
4205
  * @returns {Axios} A new instance of Axios
4206
4206
  */
4207
4207
  function createInstance(defaultConfig) {
4208
- const context = new Axios(defaultConfig);
4209
- const instance = bind(Axios.prototype.request, context);
4208
+ const context = new Axios$1(defaultConfig);
4209
+ const instance = bind(Axios$1.prototype.request, context);
4210
4210
 
4211
4211
  // Copy axios.prototype to instance
4212
- utils$1.extend(instance, Axios.prototype, context, {allOwnKeys: true});
4212
+ utils$1.extend(instance, Axios$1.prototype, context, {allOwnKeys: true});
4213
4213
 
4214
4214
  // Copy context to instance
4215
4215
  utils$1.extend(instance, context, null, {allOwnKeys: true});
4216
4216
 
4217
4217
  // Factory for creating new instances
4218
4218
  instance.create = function create(instanceConfig) {
4219
- return createInstance(mergeConfig(defaultConfig, instanceConfig));
4219
+ return createInstance(mergeConfig$1(defaultConfig, instanceConfig));
4220
4220
  };
4221
4221
 
4222
4222
  return instance;
@@ -4226,17 +4226,17 @@ function createInstance(defaultConfig) {
4226
4226
  const axios = createInstance(defaults);
4227
4227
 
4228
4228
  // Expose Axios class to allow class inheritance
4229
- axios.Axios = Axios;
4229
+ axios.Axios = Axios$1;
4230
4230
 
4231
4231
  // Expose Cancel & CancelToken
4232
- axios.CanceledError = CanceledError;
4233
- axios.CancelToken = CancelToken;
4234
- axios.isCancel = isCancel;
4235
- axios.VERSION = VERSION;
4236
- axios.toFormData = toFormData;
4232
+ axios.CanceledError = CanceledError$1;
4233
+ axios.CancelToken = CancelToken$1;
4234
+ axios.isCancel = isCancel$1;
4235
+ axios.VERSION = VERSION$1;
4236
+ axios.toFormData = toFormData$1;
4237
4237
 
4238
4238
  // Expose AxiosError class
4239
- axios.AxiosError = AxiosError;
4239
+ axios.AxiosError = AxiosError$1;
4240
4240
 
4241
4241
  // alias for CanceledError for backward compatibility
4242
4242
  axios.Cancel = axios.CanceledError;
@@ -4246,24 +4246,46 @@ axios.all = function all(promises) {
4246
4246
  return Promise.all(promises);
4247
4247
  };
4248
4248
 
4249
- axios.spread = spread;
4249
+ axios.spread = spread$1;
4250
4250
 
4251
4251
  // Expose isAxiosError
4252
- axios.isAxiosError = isAxiosError;
4252
+ axios.isAxiosError = isAxiosError$1;
4253
4253
 
4254
4254
  // Expose mergeConfig
4255
- axios.mergeConfig = mergeConfig;
4255
+ axios.mergeConfig = mergeConfig$1;
4256
4256
 
4257
- axios.AxiosHeaders = AxiosHeaders;
4257
+ axios.AxiosHeaders = AxiosHeaders$1;
4258
4258
 
4259
4259
  axios.formToJSON = thing => formDataToJSON(utils$1.isHTMLForm(thing) ? new FormData(thing) : thing);
4260
4260
 
4261
4261
  axios.getAdapter = adapters.getAdapter;
4262
4262
 
4263
- axios.HttpStatusCode = HttpStatusCode;
4263
+ axios.HttpStatusCode = HttpStatusCode$1;
4264
4264
 
4265
4265
  axios.default = axios;
4266
4266
 
4267
+ // This module is intended to unwrap Axios default export as named.
4268
+ // Keep top-level export same with static properties
4269
+ // so that it can keep same with es module or cjs
4270
+ const {
4271
+ Axios,
4272
+ AxiosError,
4273
+ CanceledError,
4274
+ isCancel,
4275
+ CancelToken,
4276
+ VERSION,
4277
+ all,
4278
+ Cancel,
4279
+ isAxiosError,
4280
+ spread,
4281
+ toFormData,
4282
+ AxiosHeaders,
4283
+ HttpStatusCode,
4284
+ formToJSON,
4285
+ getAdapter,
4286
+ mergeConfig
4287
+ } = axios;
4288
+
4267
4289
  /******************************************************************************
4268
4290
  Copyright (c) Microsoft Corporation.
4269
4291