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.

package/dist/esm/axios.js CHANGED
@@ -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
  function bind(fn, thisArg) {
3
3
  return function wrap() {
4
4
  return fn.apply(thisArg, arguments);
@@ -665,6 +665,11 @@ const toJSONObject = (obj) => {
665
665
  return visit(obj, 0);
666
666
  };
667
667
 
668
+ const isAsyncFn = kindOfTest('AsyncFunction');
669
+
670
+ const isThenable = (thing) =>
671
+ thing && (isObject(thing) || isFunction(thing)) && isFunction(thing.then) && isFunction(thing.catch);
672
+
668
673
  const utils = {
669
674
  isArray,
670
675
  isArrayBuffer,
@@ -714,7 +719,9 @@ const utils = {
714
719
  ALPHABET,
715
720
  generateString,
716
721
  isSpecCompliantForm,
717
- toJSONObject
722
+ toJSONObject,
723
+ isAsyncFn,
724
+ isThenable
718
725
  };
719
726
 
720
727
  /**
@@ -2202,8 +2209,12 @@ const xhrAdapter = isXHRAdapterSupported && function (config) {
2202
2209
  }
2203
2210
  }
2204
2211
 
2205
- if (utils.isFormData(requestData) && (platform.isStandardBrowserEnv || platform.isStandardBrowserWebWorkerEnv)) {
2206
- requestHeaders.setContentType(false); // Let the browser set it
2212
+ if (utils.isFormData(requestData)) {
2213
+ if (platform.isStandardBrowserEnv || platform.isStandardBrowserWebWorkerEnv) {
2214
+ requestHeaders.setContentType(false); // Let the browser set it
2215
+ } else {
2216
+ requestHeaders.setContentType('multipart/form-data;', false); // mobile/desktop app frameworks
2217
+ }
2207
2218
  }
2208
2219
 
2209
2220
  let request = new XMLHttpRequest();
@@ -2609,7 +2620,7 @@ function mergeConfig$1(config1, config2) {
2609
2620
  headers: (a, b) => mergeDeepProperties(headersToObject(a), headersToObject(b), true)
2610
2621
  };
2611
2622
 
2612
- utils.forEach(Object.keys(config1).concat(Object.keys(config2)), function computeConfigValue(prop) {
2623
+ utils.forEach(Object.keys(Object.assign({}, config1, config2)), function computeConfigValue(prop) {
2613
2624
  const merge = mergeMap[prop] || mergeDeepProperties;
2614
2625
  const configValue = merge(config1[prop], config2[prop], prop);
2615
2626
  (utils.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue);
@@ -2618,7 +2629,7 @@ function mergeConfig$1(config1, config2) {
2618
2629
  return config;
2619
2630
  }
2620
2631
 
2621
- const VERSION$1 = "1.3.6";
2632
+ const VERSION$1 = "1.4.0";
2622
2633
 
2623
2634
  const validators$1 = {};
2624
2635