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/CHANGELOG.md
CHANGED
@@ -1,5 +1,30 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
# [1.4.0](https://github.com/axios/axios/compare/v1.3.6...v1.4.0) (2023-04-27)
|
4
|
+
|
5
|
+
|
6
|
+
### Bug Fixes
|
7
|
+
|
8
|
+
* **formdata:** add `multipart/form-data` content type for FormData payload on custom client environments; ([#5678](https://github.com/axios/axios/issues/5678)) ([bbb61e7](https://github.com/axios/axios/commit/bbb61e70cb1185adfb1cbbb86eaf6652c48d89d1))
|
9
|
+
* **package:** export package internals with unsafe path prefix; ([#5677](https://github.com/axios/axios/issues/5677)) ([df38c94](https://github.com/axios/axios/commit/df38c949f26414d88ba29ec1e353c4d4f97eaf09))
|
10
|
+
|
11
|
+
|
12
|
+
### Features
|
13
|
+
|
14
|
+
* **dns:** added support for a custom lookup function; ([#5339](https://github.com/axios/axios/issues/5339)) ([2701911](https://github.com/axios/axios/commit/2701911260a1faa5cc5e1afe437121b330a3b7bb))
|
15
|
+
* **types:** export `AxiosHeaderValue` type. ([#5525](https://github.com/axios/axios/issues/5525)) ([726f1c8](https://github.com/axios/axios/commit/726f1c8e00cffa0461a8813a9bdcb8f8b9d762cf))
|
16
|
+
|
17
|
+
|
18
|
+
### Performance Improvements
|
19
|
+
|
20
|
+
* **merge-config:** optimize mergeConfig performance by avoiding duplicate key visits; ([#5679](https://github.com/axios/axios/issues/5679)) ([e6f7053](https://github.com/axios/axios/commit/e6f7053bf1a3e87cf1f9da8677e12e3fe829d68e))
|
21
|
+
|
22
|
+
### Contributors to this release
|
23
|
+
|
24
|
+
- <img src="https://avatars.githubusercontent.com/u/12586868?v=4&s=18" alt="avatar" width="18"/> [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS "+151/-16 (#5684 #5339 #5679 #5678 #5677 )")
|
25
|
+
- <img src="https://avatars.githubusercontent.com/u/47537704?v=4&s=18" alt="avatar" width="18"/> [Arthur Fiorette](https://github.com/arthurfiorette "+19/-19 (#5525 )")
|
26
|
+
- <img src="https://avatars.githubusercontent.com/u/43876655?v=4&s=18" alt="avatar" width="18"/> [PIYUSH NEGI](https://github.com/npiyush97 "+2/-18 (#5670 )")
|
27
|
+
|
3
28
|
## [1.3.6](https://github.com/axios/axios/compare/v1.3.5...v1.3.6) (2023-04-19)
|
4
29
|
|
5
30
|
|
package/dist/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 (global, factory) {
|
3
3
|
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
|
4
4
|
typeof define === 'function' && define.amd ? define(factory) :
|
@@ -722,6 +722,10 @@
|
|
722
722
|
};
|
723
723
|
return visit(obj, 0);
|
724
724
|
};
|
725
|
+
var isAsyncFn = kindOfTest('AsyncFunction');
|
726
|
+
var isThenable = function isThenable(thing) {
|
727
|
+
return thing && (isObject(thing) || isFunction(thing)) && isFunction(thing.then) && isFunction(thing["catch"]);
|
728
|
+
};
|
725
729
|
var utils = {
|
726
730
|
isArray: isArray,
|
727
731
|
isArrayBuffer: isArrayBuffer,
|
@@ -772,7 +776,9 @@
|
|
772
776
|
ALPHABET: ALPHABET,
|
773
777
|
generateString: generateString,
|
774
778
|
isSpecCompliantForm: isSpecCompliantForm,
|
775
|
-
toJSONObject: toJSONObject
|
779
|
+
toJSONObject: toJSONObject,
|
780
|
+
isAsyncFn: isAsyncFn,
|
781
|
+
isThenable: isThenable
|
776
782
|
};
|
777
783
|
|
778
784
|
/**
|
@@ -2061,8 +2067,12 @@
|
|
2061
2067
|
config.signal.removeEventListener('abort', onCanceled);
|
2062
2068
|
}
|
2063
2069
|
}
|
2064
|
-
if (utils.isFormData(requestData)
|
2065
|
-
|
2070
|
+
if (utils.isFormData(requestData)) {
|
2071
|
+
if (platform.isStandardBrowserEnv || platform.isStandardBrowserWebWorkerEnv) {
|
2072
|
+
requestHeaders.setContentType(false); // Let the browser set it
|
2073
|
+
} else {
|
2074
|
+
requestHeaders.setContentType('multipart/form-data;', false); // mobile/desktop app frameworks
|
2075
|
+
}
|
2066
2076
|
}
|
2067
2077
|
|
2068
2078
|
var request = new XMLHttpRequest();
|
@@ -2422,7 +2432,7 @@
|
|
2422
2432
|
return mergeDeepProperties(headersToObject(a), headersToObject(b), true);
|
2423
2433
|
}
|
2424
2434
|
};
|
2425
|
-
utils.forEach(Object.keys(
|
2435
|
+
utils.forEach(Object.keys(Object.assign({}, config1, config2)), function computeConfigValue(prop) {
|
2426
2436
|
var merge = mergeMap[prop] || mergeDeepProperties;
|
2427
2437
|
var configValue = merge(config1[prop], config2[prop], prop);
|
2428
2438
|
utils.isUndefined(configValue) && merge !== mergeDirectKeys || (config[prop] = configValue);
|
@@ -2430,7 +2440,7 @@
|
|
2430
2440
|
return config;
|
2431
2441
|
}
|
2432
2442
|
|
2433
|
-
var VERSION = "1.
|
2443
|
+
var VERSION = "1.4.0";
|
2434
2444
|
|
2435
2445
|
var validators$1 = {};
|
2436
2446
|
|