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/esm/axios.js
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
// Axios v1.
|
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)
|
2206
|
-
|
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(
|
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.
|
2632
|
+
const VERSION$1 = "1.4.0";
|
2622
2633
|
|
2623
2634
|
const validators$1 = {};
|
2624
2635
|
|