axios 1.3.6 → 1.4.0

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.

Potentially problematic release.


This version of axios might be problematic. Click here for more details.

@@ -1,4 +1,4 @@
1
- // Axios v1.3.6 Copyright (c) 2023 Matt Zabriskie and contributors
1
+ // Axios v1.4.0 Copyright (c) 2023 Matt Zabriskie and contributors
2
2
  'use strict';
3
3
 
4
4
  function bind(fn, thisArg) {
@@ -667,6 +667,11 @@ const toJSONObject = (obj) => {
667
667
  return visit(obj, 0);
668
668
  };
669
669
 
670
+ const isAsyncFn = kindOfTest('AsyncFunction');
671
+
672
+ const isThenable = (thing) =>
673
+ thing && (isObject(thing) || isFunction(thing)) && isFunction(thing.then) && isFunction(thing.catch);
674
+
670
675
  var utils = {
671
676
  isArray,
672
677
  isArrayBuffer,
@@ -716,7 +721,9 @@ var utils = {
716
721
  ALPHABET,
717
722
  generateString,
718
723
  isSpecCompliantForm,
719
- toJSONObject
724
+ toJSONObject,
725
+ isAsyncFn,
726
+ isThenable
720
727
  };
721
728
 
722
729
  /**
@@ -2204,8 +2211,12 @@ var xhrAdapter = isXHRAdapterSupported && function (config) {
2204
2211
  }
2205
2212
  }
2206
2213
 
2207
- if (utils.isFormData(requestData) && (platform.isStandardBrowserEnv || platform.isStandardBrowserWebWorkerEnv)) {
2208
- requestHeaders.setContentType(false); // Let the browser set it
2214
+ if (utils.isFormData(requestData)) {
2215
+ if (platform.isStandardBrowserEnv || platform.isStandardBrowserWebWorkerEnv) {
2216
+ requestHeaders.setContentType(false); // Let the browser set it
2217
+ } else {
2218
+ requestHeaders.setContentType('multipart/form-data;', false); // mobile/desktop app frameworks
2219
+ }
2209
2220
  }
2210
2221
 
2211
2222
  let request = new XMLHttpRequest();
@@ -2611,7 +2622,7 @@ function mergeConfig(config1, config2) {
2611
2622
  headers: (a, b) => mergeDeepProperties(headersToObject(a), headersToObject(b), true)
2612
2623
  };
2613
2624
 
2614
- utils.forEach(Object.keys(config1).concat(Object.keys(config2)), function computeConfigValue(prop) {
2625
+ utils.forEach(Object.keys(Object.assign({}, config1, config2)), function computeConfigValue(prop) {
2615
2626
  const merge = mergeMap[prop] || mergeDeepProperties;
2616
2627
  const configValue = merge(config1[prop], config2[prop], prop);
2617
2628
  (utils.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue);
@@ -2620,7 +2631,7 @@ function mergeConfig(config1, config2) {
2620
2631
  return config;
2621
2632
  }
2622
2633
 
2623
- const VERSION = "1.3.6";
2634
+ const VERSION = "1.4.0";
2624
2635
 
2625
2636
  const validators$1 = {};
2626
2637