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/CHANGELOG.md +25 -0
- package/dist/axios.js +16 -6
- package/dist/axios.js.map +1 -1
- package/dist/axios.min.js +1 -1
- package/dist/axios.min.js.map +1 -1
- package/dist/browser/axios.cjs +17 -6
- package/dist/browser/axios.cjs.map +1 -1
- package/dist/esm/axios.js +17 -6
- package/dist/esm/axios.js.map +1 -1
- package/dist/esm/axios.min.js +1 -1
- package/dist/esm/axios.min.js.map +1 -1
- package/dist/node/axios.cjs +46 -7
- package/dist/node/axios.cjs.map +1 -1
- package/index.d.cts +21 -18
- package/index.d.ts +5 -2
- package/lib/adapters/http.js +15 -1
- package/lib/adapters/xhr.js +6 -2
- package/lib/core/mergeConfig.js +1 -1
- package/lib/env/data.js +1 -1
- package/lib/helpers/callbackify.js +16 -0
- package/lib/utils.js +8 -1
- package/package.json +12 -3
package/dist/browser/axios.cjs
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
// Axios v1.
|
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)
|
2208
|
-
|
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(
|
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.
|
2634
|
+
const VERSION = "1.4.0";
|
2624
2635
|
|
2625
2636
|
const validators$1 = {};
|
2626
2637
|
|