axios 1.6.0 → 1.6.1
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 +13 -0
- package/dist/axios.js +189 -130
- 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 +141 -139
- package/dist/browser/axios.cjs.map +1 -1
- package/dist/esm/axios.js +141 -139
- 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 +204 -151
- package/dist/node/axios.cjs.map +1 -1
- package/lib/adapters/xhr.js +5 -6
- package/lib/env/data.js +1 -1
- package/lib/helpers/cookies.js +1 -1
- package/lib/helpers/isURLSameOrigin.js +1 -1
- package/lib/platform/browser/index.js +0 -51
- package/lib/platform/common/utils.js +47 -0
- package/lib/platform/index.js +5 -1
- package/package.json +2 -1
package/dist/axios.js
CHANGED
@@ -1,10 +1,31 @@
|
|
1
|
-
// Axios v1.6.
|
1
|
+
// Axios v1.6.1 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) :
|
5
5
|
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.axios = factory());
|
6
6
|
})(this, (function () { 'use strict';
|
7
7
|
|
8
|
+
function ownKeys(object, enumerableOnly) {
|
9
|
+
var keys = Object.keys(object);
|
10
|
+
if (Object.getOwnPropertySymbols) {
|
11
|
+
var symbols = Object.getOwnPropertySymbols(object);
|
12
|
+
enumerableOnly && (symbols = symbols.filter(function (sym) {
|
13
|
+
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
14
|
+
})), keys.push.apply(keys, symbols);
|
15
|
+
}
|
16
|
+
return keys;
|
17
|
+
}
|
18
|
+
function _objectSpread2(target) {
|
19
|
+
for (var i = 1; i < arguments.length; i++) {
|
20
|
+
var source = null != arguments[i] ? arguments[i] : {};
|
21
|
+
i % 2 ? ownKeys(Object(source), !0).forEach(function (key) {
|
22
|
+
_defineProperty(target, key, source[key]);
|
23
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) {
|
24
|
+
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
25
|
+
});
|
26
|
+
}
|
27
|
+
return target;
|
28
|
+
}
|
8
29
|
function _typeof(obj) {
|
9
30
|
"@babel/helpers - typeof";
|
10
31
|
|
@@ -36,12 +57,37 @@
|
|
36
57
|
});
|
37
58
|
return Constructor;
|
38
59
|
}
|
60
|
+
function _defineProperty(obj, key, value) {
|
61
|
+
if (key in obj) {
|
62
|
+
Object.defineProperty(obj, key, {
|
63
|
+
value: value,
|
64
|
+
enumerable: true,
|
65
|
+
configurable: true,
|
66
|
+
writable: true
|
67
|
+
});
|
68
|
+
} else {
|
69
|
+
obj[key] = value;
|
70
|
+
}
|
71
|
+
return obj;
|
72
|
+
}
|
39
73
|
function _slicedToArray(arr, i) {
|
40
74
|
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
|
41
75
|
}
|
76
|
+
function _toArray(arr) {
|
77
|
+
return _arrayWithHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableRest();
|
78
|
+
}
|
79
|
+
function _toConsumableArray(arr) {
|
80
|
+
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
|
81
|
+
}
|
82
|
+
function _arrayWithoutHoles(arr) {
|
83
|
+
if (Array.isArray(arr)) return _arrayLikeToArray(arr);
|
84
|
+
}
|
42
85
|
function _arrayWithHoles(arr) {
|
43
86
|
if (Array.isArray(arr)) return arr;
|
44
87
|
}
|
88
|
+
function _iterableToArray(iter) {
|
89
|
+
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
90
|
+
}
|
45
91
|
function _iterableToArrayLimit(arr, i) {
|
46
92
|
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
47
93
|
if (_i == null) return;
|
@@ -79,6 +125,9 @@
|
|
79
125
|
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
80
126
|
return arr2;
|
81
127
|
}
|
128
|
+
function _nonIterableSpread() {
|
129
|
+
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
130
|
+
}
|
82
131
|
function _nonIterableRest() {
|
83
132
|
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
84
133
|
}
|
@@ -727,7 +776,7 @@
|
|
727
776
|
var isThenable = function isThenable(thing) {
|
728
777
|
return thing && (isObject(thing) || isFunction(thing)) && isFunction(thing.then) && isFunction(thing["catch"]);
|
729
778
|
};
|
730
|
-
var utils = {
|
779
|
+
var utils$1 = {
|
731
780
|
isArray: isArray,
|
732
781
|
isArrayBuffer: isArrayBuffer,
|
733
782
|
isBuffer: isBuffer,
|
@@ -807,7 +856,7 @@
|
|
807
856
|
request && (this.request = request);
|
808
857
|
response && (this.response = response);
|
809
858
|
}
|
810
|
-
utils.inherits(AxiosError, Error, {
|
859
|
+
utils$1.inherits(AxiosError, Error, {
|
811
860
|
toJSON: function toJSON() {
|
812
861
|
return {
|
813
862
|
// Standard
|
@@ -822,7 +871,7 @@
|
|
822
871
|
columnNumber: this.columnNumber,
|
823
872
|
stack: this.stack,
|
824
873
|
// Axios
|
825
|
-
config: utils.toJSONObject(this.config),
|
874
|
+
config: utils$1.toJSONObject(this.config),
|
826
875
|
code: this.code,
|
827
876
|
status: this.response && this.response.status ? this.response.status : null
|
828
877
|
};
|
@@ -845,7 +894,7 @@
|
|
845
894
|
// eslint-disable-next-line func-names
|
846
895
|
AxiosError.from = function (error, code, config, request, response, customProps) {
|
847
896
|
var axiosError = Object.create(prototype$1);
|
848
|
-
utils.toFlatObject(error, axiosError, function filter(obj) {
|
897
|
+
utils$1.toFlatObject(error, axiosError, function filter(obj) {
|
849
898
|
return obj !== Error.prototype;
|
850
899
|
}, function (prop) {
|
851
900
|
return prop !== 'isAxiosError';
|
@@ -868,7 +917,7 @@
|
|
868
917
|
* @returns {boolean}
|
869
918
|
*/
|
870
919
|
function isVisitable(thing) {
|
871
|
-
return utils.isPlainObject(thing) || utils.isArray(thing);
|
920
|
+
return utils$1.isPlainObject(thing) || utils$1.isArray(thing);
|
872
921
|
}
|
873
922
|
|
874
923
|
/**
|
@@ -879,7 +928,7 @@
|
|
879
928
|
* @returns {string} the key without the brackets.
|
880
929
|
*/
|
881
930
|
function removeBrackets(key) {
|
882
|
-
return utils.endsWith(key, '[]') ? key.slice(0, -2) : key;
|
931
|
+
return utils$1.endsWith(key, '[]') ? key.slice(0, -2) : key;
|
883
932
|
}
|
884
933
|
|
885
934
|
/**
|
@@ -908,9 +957,9 @@
|
|
908
957
|
* @returns {boolean}
|
909
958
|
*/
|
910
959
|
function isFlatArray(arr) {
|
911
|
-
return utils.isArray(arr) && !arr.some(isVisitable);
|
960
|
+
return utils$1.isArray(arr) && !arr.some(isVisitable);
|
912
961
|
}
|
913
|
-
var predicates = utils.toFlatObject(utils, {}, null, function filter(prop) {
|
962
|
+
var predicates = utils$1.toFlatObject(utils$1, {}, null, function filter(prop) {
|
914
963
|
return /^is[A-Z]/.test(prop);
|
915
964
|
});
|
916
965
|
|
@@ -938,7 +987,7 @@
|
|
938
987
|
* @returns
|
939
988
|
*/
|
940
989
|
function toFormData(obj, formData, options) {
|
941
|
-
if (!utils.isObject(obj)) {
|
990
|
+
if (!utils$1.isObject(obj)) {
|
942
991
|
throw new TypeError('target must be an object');
|
943
992
|
}
|
944
993
|
|
@@ -946,13 +995,13 @@
|
|
946
995
|
formData = formData || new (FormData)();
|
947
996
|
|
948
997
|
// eslint-disable-next-line no-param-reassign
|
949
|
-
options = utils.toFlatObject(options, {
|
998
|
+
options = utils$1.toFlatObject(options, {
|
950
999
|
metaTokens: true,
|
951
1000
|
dots: false,
|
952
1001
|
indexes: false
|
953
1002
|
}, false, function defined(option, source) {
|
954
1003
|
// eslint-disable-next-line no-eq-null,eqeqeq
|
955
|
-
return !utils.isUndefined(source[option]);
|
1004
|
+
return !utils$1.isUndefined(source[option]);
|
956
1005
|
});
|
957
1006
|
var metaTokens = options.metaTokens;
|
958
1007
|
// eslint-disable-next-line no-use-before-define
|
@@ -960,19 +1009,19 @@
|
|
960
1009
|
var dots = options.dots;
|
961
1010
|
var indexes = options.indexes;
|
962
1011
|
var _Blob = options.Blob || typeof Blob !== 'undefined' && Blob;
|
963
|
-
var useBlob = _Blob && utils.isSpecCompliantForm(formData);
|
964
|
-
if (!utils.isFunction(visitor)) {
|
1012
|
+
var useBlob = _Blob && utils$1.isSpecCompliantForm(formData);
|
1013
|
+
if (!utils$1.isFunction(visitor)) {
|
965
1014
|
throw new TypeError('visitor must be a function');
|
966
1015
|
}
|
967
1016
|
function convertValue(value) {
|
968
1017
|
if (value === null) return '';
|
969
|
-
if (utils.isDate(value)) {
|
1018
|
+
if (utils$1.isDate(value)) {
|
970
1019
|
return value.toISOString();
|
971
1020
|
}
|
972
|
-
if (!useBlob && utils.isBlob(value)) {
|
1021
|
+
if (!useBlob && utils$1.isBlob(value)) {
|
973
1022
|
throw new AxiosError('Blob is not supported. Use a Buffer instead.');
|
974
1023
|
}
|
975
|
-
if (utils.isArrayBuffer(value) || utils.isTypedArray(value)) {
|
1024
|
+
if (utils$1.isArrayBuffer(value) || utils$1.isTypedArray(value)) {
|
976
1025
|
return useBlob && typeof Blob === 'function' ? new Blob([value]) : Buffer.from(value);
|
977
1026
|
}
|
978
1027
|
return value;
|
@@ -991,16 +1040,16 @@
|
|
991
1040
|
function defaultVisitor(value, key, path) {
|
992
1041
|
var arr = value;
|
993
1042
|
if (value && !path && _typeof(value) === 'object') {
|
994
|
-
if (utils.endsWith(key, '{}')) {
|
1043
|
+
if (utils$1.endsWith(key, '{}')) {
|
995
1044
|
// eslint-disable-next-line no-param-reassign
|
996
1045
|
key = metaTokens ? key : key.slice(0, -2);
|
997
1046
|
// eslint-disable-next-line no-param-reassign
|
998
1047
|
value = JSON.stringify(value);
|
999
|
-
} else if (utils.isArray(value) && isFlatArray(value) || (utils.isFileList(value) || utils.endsWith(key, '[]')) && (arr = utils.toArray(value))) {
|
1048
|
+
} else if (utils$1.isArray(value) && isFlatArray(value) || (utils$1.isFileList(value) || utils$1.endsWith(key, '[]')) && (arr = utils$1.toArray(value))) {
|
1000
1049
|
// eslint-disable-next-line no-param-reassign
|
1001
1050
|
key = removeBrackets(key);
|
1002
1051
|
arr.forEach(function each(el, index) {
|
1003
|
-
!(utils.isUndefined(el) || el === null) && formData.append(
|
1052
|
+
!(utils$1.isUndefined(el) || el === null) && formData.append(
|
1004
1053
|
// eslint-disable-next-line no-nested-ternary
|
1005
1054
|
indexes === true ? renderKey([key], index, dots) : indexes === null ? key : key + '[]', convertValue(el));
|
1006
1055
|
});
|
@@ -1020,20 +1069,20 @@
|
|
1020
1069
|
isVisitable: isVisitable
|
1021
1070
|
});
|
1022
1071
|
function build(value, path) {
|
1023
|
-
if (utils.isUndefined(value)) return;
|
1072
|
+
if (utils$1.isUndefined(value)) return;
|
1024
1073
|
if (stack.indexOf(value) !== -1) {
|
1025
1074
|
throw Error('Circular reference detected in ' + path.join('.'));
|
1026
1075
|
}
|
1027
1076
|
stack.push(value);
|
1028
|
-
utils.forEach(value, function each(el, key) {
|
1029
|
-
var result = !(utils.isUndefined(el) || el === null) && visitor.call(formData, el, utils.isString(key) ? key.trim() : key, path, exposedHelpers);
|
1077
|
+
utils$1.forEach(value, function each(el, key) {
|
1078
|
+
var result = !(utils$1.isUndefined(el) || el === null) && visitor.call(formData, el, utils$1.isString(key) ? key.trim() : key, path, exposedHelpers);
|
1030
1079
|
if (result === true) {
|
1031
1080
|
build(el, path ? path.concat(key) : [key]);
|
1032
1081
|
}
|
1033
1082
|
});
|
1034
1083
|
stack.pop();
|
1035
1084
|
}
|
1036
|
-
if (!utils.isObject(obj)) {
|
1085
|
+
if (!utils$1.isObject(obj)) {
|
1037
1086
|
throw new TypeError('data must be an object');
|
1038
1087
|
}
|
1039
1088
|
build(obj);
|
@@ -1120,7 +1169,7 @@
|
|
1120
1169
|
if (serializeFn) {
|
1121
1170
|
serializedParams = serializeFn(params, options);
|
1122
1171
|
} else {
|
1123
|
-
serializedParams = utils.isURLSearchParams(params) ? params.toString() : new AxiosURLSearchParams(params, options).toString(_encode);
|
1172
|
+
serializedParams = utils$1.isURLSearchParams(params) ? params.toString() : new AxiosURLSearchParams(params, options).toString(_encode);
|
1124
1173
|
}
|
1125
1174
|
if (serializedParams) {
|
1126
1175
|
var hashmarkIndex = url.indexOf("#");
|
@@ -1199,7 +1248,7 @@
|
|
1199
1248
|
}, {
|
1200
1249
|
key: "forEach",
|
1201
1250
|
value: function forEach(fn) {
|
1202
|
-
utils.forEach(this.handlers, function forEachHandler(h) {
|
1251
|
+
utils$1.forEach(this.handlers, function forEachHandler(h) {
|
1203
1252
|
if (h !== null) {
|
1204
1253
|
fn(h);
|
1205
1254
|
}
|
@@ -1222,6 +1271,18 @@
|
|
1222
1271
|
|
1223
1272
|
var Blob$1 = typeof Blob !== 'undefined' ? Blob : null;
|
1224
1273
|
|
1274
|
+
var platform$1 = {
|
1275
|
+
isBrowser: true,
|
1276
|
+
classes: {
|
1277
|
+
URLSearchParams: URLSearchParams$1,
|
1278
|
+
FormData: FormData$1,
|
1279
|
+
Blob: Blob$1
|
1280
|
+
},
|
1281
|
+
protocols: ['http', 'https', 'file', 'blob', 'url', 'data']
|
1282
|
+
};
|
1283
|
+
|
1284
|
+
var hasBrowserEnv = typeof window !== 'undefined' && typeof document !== 'undefined';
|
1285
|
+
|
1225
1286
|
/**
|
1226
1287
|
* Determine if we're running in a standard browser environment
|
1227
1288
|
*
|
@@ -1239,13 +1300,9 @@
|
|
1239
1300
|
*
|
1240
1301
|
* @returns {boolean}
|
1241
1302
|
*/
|
1242
|
-
var
|
1243
|
-
|
1244
|
-
|
1245
|
-
return false;
|
1246
|
-
}
|
1247
|
-
return typeof window !== 'undefined' && typeof document !== 'undefined';
|
1248
|
-
}();
|
1303
|
+
var hasStandardBrowserEnv = function (product) {
|
1304
|
+
return hasBrowserEnv && ['ReactNative', 'NativeScript', 'NS'].indexOf(product) < 0;
|
1305
|
+
}(typeof navigator !== 'undefined' && navigator.product);
|
1249
1306
|
|
1250
1307
|
/**
|
1251
1308
|
* Determine if we're running in a standard browser webWorker environment
|
@@ -1256,27 +1313,25 @@
|
|
1256
1313
|
* `typeof window !== 'undefined' && typeof document !== 'undefined'`.
|
1257
1314
|
* This leads to a problem when axios post `FormData` in webWorker
|
1258
1315
|
*/
|
1259
|
-
var
|
1316
|
+
var hasStandardBrowserWebWorkerEnv = function () {
|
1260
1317
|
return typeof WorkerGlobalScope !== 'undefined' &&
|
1261
1318
|
// eslint-disable-next-line no-undef
|
1262
1319
|
self instanceof WorkerGlobalScope && typeof self.importScripts === 'function';
|
1263
1320
|
}();
|
1264
|
-
|
1265
|
-
|
1266
|
-
|
1267
|
-
|
1268
|
-
|
1269
|
-
|
1270
|
-
|
1271
|
-
|
1272
|
-
|
1273
|
-
protocols: ['http', 'https', 'file', 'blob', 'url', 'data']
|
1274
|
-
};
|
1321
|
+
|
1322
|
+
var utils = /*#__PURE__*/Object.freeze({
|
1323
|
+
__proto__: null,
|
1324
|
+
hasBrowserEnv: hasBrowserEnv,
|
1325
|
+
hasStandardBrowserWebWorkerEnv: hasStandardBrowserWebWorkerEnv,
|
1326
|
+
hasStandardBrowserEnv: hasStandardBrowserEnv
|
1327
|
+
});
|
1328
|
+
|
1329
|
+
var platform = _objectSpread2(_objectSpread2({}, utils), platform$1);
|
1275
1330
|
|
1276
1331
|
function toURLEncodedForm(data, options) {
|
1277
1332
|
return toFormData(data, new platform.classes.URLSearchParams(), Object.assign({
|
1278
1333
|
visitor: function visitor(value, key, path, helpers) {
|
1279
|
-
if (platform.isNode && utils.isBuffer(value)) {
|
1334
|
+
if (platform.isNode && utils$1.isBuffer(value)) {
|
1280
1335
|
this.append(key, value.toString('base64'));
|
1281
1336
|
return false;
|
1282
1337
|
}
|
@@ -1297,7 +1352,7 @@
|
|
1297
1352
|
// foo.x.y.z
|
1298
1353
|
// foo-x-y-z
|
1299
1354
|
// foo x y z
|
1300
|
-
return utils.matchAll(/\w+|\[(\w*)]/g, name).map(function (match) {
|
1355
|
+
return utils$1.matchAll(/\w+|\[(\w*)]/g, name).map(function (match) {
|
1301
1356
|
return match[0] === '[]' ? '' : match[1] || match[0];
|
1302
1357
|
});
|
1303
1358
|
}
|
@@ -1334,27 +1389,27 @@
|
|
1334
1389
|
var name = path[index++];
|
1335
1390
|
var isNumericKey = Number.isFinite(+name);
|
1336
1391
|
var isLast = index >= path.length;
|
1337
|
-
name = !name && utils.isArray(target) ? target.length : name;
|
1392
|
+
name = !name && utils$1.isArray(target) ? target.length : name;
|
1338
1393
|
if (isLast) {
|
1339
|
-
if (utils.hasOwnProp(target, name)) {
|
1394
|
+
if (utils$1.hasOwnProp(target, name)) {
|
1340
1395
|
target[name] = [target[name], value];
|
1341
1396
|
} else {
|
1342
1397
|
target[name] = value;
|
1343
1398
|
}
|
1344
1399
|
return !isNumericKey;
|
1345
1400
|
}
|
1346
|
-
if (!target[name] || !utils.isObject(target[name])) {
|
1401
|
+
if (!target[name] || !utils$1.isObject(target[name])) {
|
1347
1402
|
target[name] = [];
|
1348
1403
|
}
|
1349
1404
|
var result = buildPath(path, value, target[name], index);
|
1350
|
-
if (result && utils.isArray(target[name])) {
|
1405
|
+
if (result && utils$1.isArray(target[name])) {
|
1351
1406
|
target[name] = arrayToObject(target[name]);
|
1352
1407
|
}
|
1353
1408
|
return !isNumericKey;
|
1354
1409
|
}
|
1355
|
-
if (utils.isFormData(formData) && utils.isFunction(formData.entries)) {
|
1410
|
+
if (utils$1.isFormData(formData) && utils$1.isFunction(formData.entries)) {
|
1356
1411
|
var obj = {};
|
1357
|
-
utils.forEachEntry(formData, function (name, value) {
|
1412
|
+
utils$1.forEachEntry(formData, function (name, value) {
|
1358
1413
|
buildPath(parsePropPath(name), value, obj, 0);
|
1359
1414
|
});
|
1360
1415
|
return obj;
|
@@ -1373,10 +1428,10 @@
|
|
1373
1428
|
* @returns {string} A stringified version of the rawValue.
|
1374
1429
|
*/
|
1375
1430
|
function stringifySafely(rawValue, parser, encoder) {
|
1376
|
-
if (utils.isString(rawValue)) {
|
1431
|
+
if (utils$1.isString(rawValue)) {
|
1377
1432
|
try {
|
1378
1433
|
(parser || JSON.parse)(rawValue);
|
1379
|
-
return utils.trim(rawValue);
|
1434
|
+
return utils$1.trim(rawValue);
|
1380
1435
|
} catch (e) {
|
1381
1436
|
if (e.name !== 'SyntaxError') {
|
1382
1437
|
throw e;
|
@@ -1391,24 +1446,24 @@
|
|
1391
1446
|
transformRequest: [function transformRequest(data, headers) {
|
1392
1447
|
var contentType = headers.getContentType() || '';
|
1393
1448
|
var hasJSONContentType = contentType.indexOf('application/json') > -1;
|
1394
|
-
var isObjectPayload = utils.isObject(data);
|
1395
|
-
if (isObjectPayload && utils.isHTMLForm(data)) {
|
1449
|
+
var isObjectPayload = utils$1.isObject(data);
|
1450
|
+
if (isObjectPayload && utils$1.isHTMLForm(data)) {
|
1396
1451
|
data = new FormData(data);
|
1397
1452
|
}
|
1398
|
-
var isFormData = utils.isFormData(data);
|
1453
|
+
var isFormData = utils$1.isFormData(data);
|
1399
1454
|
if (isFormData) {
|
1400
1455
|
if (!hasJSONContentType) {
|
1401
1456
|
return data;
|
1402
1457
|
}
|
1403
1458
|
return hasJSONContentType ? JSON.stringify(formDataToJSON(data)) : data;
|
1404
1459
|
}
|
1405
|
-
if (utils.isArrayBuffer(data) || utils.isBuffer(data) || utils.isStream(data) || utils.isFile(data) || utils.isBlob(data)) {
|
1460
|
+
if (utils$1.isArrayBuffer(data) || utils$1.isBuffer(data) || utils$1.isStream(data) || utils$1.isFile(data) || utils$1.isBlob(data)) {
|
1406
1461
|
return data;
|
1407
1462
|
}
|
1408
|
-
if (utils.isArrayBufferView(data)) {
|
1463
|
+
if (utils$1.isArrayBufferView(data)) {
|
1409
1464
|
return data.buffer;
|
1410
1465
|
}
|
1411
|
-
if (utils.isURLSearchParams(data)) {
|
1466
|
+
if (utils$1.isURLSearchParams(data)) {
|
1412
1467
|
headers.setContentType('application/x-www-form-urlencoded;charset=utf-8', false);
|
1413
1468
|
return data.toString();
|
1414
1469
|
}
|
@@ -1417,7 +1472,7 @@
|
|
1417
1472
|
if (contentType.indexOf('application/x-www-form-urlencoded') > -1) {
|
1418
1473
|
return toURLEncodedForm(data, this.formSerializer).toString();
|
1419
1474
|
}
|
1420
|
-
if ((isFileList = utils.isFileList(data)) || contentType.indexOf('multipart/form-data') > -1) {
|
1475
|
+
if ((isFileList = utils$1.isFileList(data)) || contentType.indexOf('multipart/form-data') > -1) {
|
1421
1476
|
var _FormData = this.env && this.env.FormData;
|
1422
1477
|
return toFormData(isFileList ? {
|
1423
1478
|
'files[]': data
|
@@ -1434,7 +1489,7 @@
|
|
1434
1489
|
var transitional = this.transitional || defaults.transitional;
|
1435
1490
|
var forcedJSONParsing = transitional && transitional.forcedJSONParsing;
|
1436
1491
|
var JSONRequested = this.responseType === 'json';
|
1437
|
-
if (data && utils.isString(data) && (forcedJSONParsing && !this.responseType || JSONRequested)) {
|
1492
|
+
if (data && utils$1.isString(data) && (forcedJSONParsing && !this.responseType || JSONRequested)) {
|
1438
1493
|
var silentJSONParsing = transitional && transitional.silentJSONParsing;
|
1439
1494
|
var strictJSONParsing = !silentJSONParsing && JSONRequested;
|
1440
1495
|
try {
|
@@ -1473,14 +1528,14 @@
|
|
1473
1528
|
}
|
1474
1529
|
}
|
1475
1530
|
};
|
1476
|
-
utils.forEach(['delete', 'get', 'head', 'post', 'put', 'patch'], function (method) {
|
1531
|
+
utils$1.forEach(['delete', 'get', 'head', 'post', 'put', 'patch'], function (method) {
|
1477
1532
|
defaults.headers[method] = {};
|
1478
1533
|
});
|
1479
1534
|
var defaults$1 = defaults;
|
1480
1535
|
|
1481
1536
|
// RawAxiosHeaders whose duplicates are ignored by node
|
1482
1537
|
// c.f. https://nodejs.org/api/http.html#http_message_headers
|
1483
|
-
var ignoreDuplicateOf = utils.toObjectSet(['age', 'authorization', 'content-length', 'content-type', 'etag', 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since', 'last-modified', 'location', 'max-forwards', 'proxy-authorization', 'referer', 'retry-after', 'user-agent']);
|
1538
|
+
var ignoreDuplicateOf = utils$1.toObjectSet(['age', 'authorization', 'content-length', 'content-type', 'etag', 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since', 'last-modified', 'location', 'max-forwards', 'proxy-authorization', 'referer', 'retry-after', 'user-agent']);
|
1484
1539
|
|
1485
1540
|
/**
|
1486
1541
|
* Parse headers into an object
|
@@ -1529,7 +1584,7 @@
|
|
1529
1584
|
if (value === false || value == null) {
|
1530
1585
|
return value;
|
1531
1586
|
}
|
1532
|
-
return utils.isArray(value) ? value.map(normalizeValue) : String(value);
|
1587
|
+
return utils$1.isArray(value) ? value.map(normalizeValue) : String(value);
|
1533
1588
|
}
|
1534
1589
|
function parseTokens(str) {
|
1535
1590
|
var tokens = Object.create(null);
|
@@ -1544,17 +1599,17 @@
|
|
1544
1599
|
return /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(str.trim());
|
1545
1600
|
};
|
1546
1601
|
function matchHeaderValue(context, value, header, filter, isHeaderNameFilter) {
|
1547
|
-
if (utils.isFunction(filter)) {
|
1602
|
+
if (utils$1.isFunction(filter)) {
|
1548
1603
|
return filter.call(this, value, header);
|
1549
1604
|
}
|
1550
1605
|
if (isHeaderNameFilter) {
|
1551
1606
|
value = header;
|
1552
1607
|
}
|
1553
|
-
if (!utils.isString(value)) return;
|
1554
|
-
if (utils.isString(filter)) {
|
1608
|
+
if (!utils$1.isString(value)) return;
|
1609
|
+
if (utils$1.isString(filter)) {
|
1555
1610
|
return value.indexOf(filter) !== -1;
|
1556
1611
|
}
|
1557
|
-
if (utils.isRegExp(filter)) {
|
1612
|
+
if (utils$1.isRegExp(filter)) {
|
1558
1613
|
return filter.test(value);
|
1559
1614
|
}
|
1560
1615
|
}
|
@@ -1564,7 +1619,7 @@
|
|
1564
1619
|
});
|
1565
1620
|
}
|
1566
1621
|
function buildAccessors(obj, header) {
|
1567
|
-
var accessorName = utils.toCamelCase(' ' + header);
|
1622
|
+
var accessorName = utils$1.toCamelCase(' ' + header);
|
1568
1623
|
['get', 'set', 'has'].forEach(function (methodName) {
|
1569
1624
|
Object.defineProperty(obj, methodName + accessorName, {
|
1570
1625
|
value: function value(arg1, arg2, arg3) {
|
@@ -1588,19 +1643,19 @@
|
|
1588
1643
|
if (!lHeader) {
|
1589
1644
|
throw new Error('header name must be a non-empty string');
|
1590
1645
|
}
|
1591
|
-
var key = utils.findKey(self, lHeader);
|
1646
|
+
var key = utils$1.findKey(self, lHeader);
|
1592
1647
|
if (!key || self[key] === undefined || _rewrite === true || _rewrite === undefined && self[key] !== false) {
|
1593
1648
|
self[key || _header] = normalizeValue(_value);
|
1594
1649
|
}
|
1595
1650
|
}
|
1596
1651
|
var setHeaders = function setHeaders(headers, _rewrite) {
|
1597
|
-
return utils.forEach(headers, function (_value, _header) {
|
1652
|
+
return utils$1.forEach(headers, function (_value, _header) {
|
1598
1653
|
return setHeader(_value, _header, _rewrite);
|
1599
1654
|
});
|
1600
1655
|
};
|
1601
|
-
if (utils.isPlainObject(header) || header instanceof this.constructor) {
|
1656
|
+
if (utils$1.isPlainObject(header) || header instanceof this.constructor) {
|
1602
1657
|
setHeaders(header, valueOrRewrite);
|
1603
|
-
} else if (utils.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) {
|
1658
|
+
} else if (utils$1.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) {
|
1604
1659
|
setHeaders(parseHeaders(header), valueOrRewrite);
|
1605
1660
|
} else {
|
1606
1661
|
header != null && setHeader(valueOrRewrite, header, rewrite);
|
@@ -1612,7 +1667,7 @@
|
|
1612
1667
|
value: function get(header, parser) {
|
1613
1668
|
header = normalizeHeader(header);
|
1614
1669
|
if (header) {
|
1615
|
-
var key = utils.findKey(this, header);
|
1670
|
+
var key = utils$1.findKey(this, header);
|
1616
1671
|
if (key) {
|
1617
1672
|
var value = this[key];
|
1618
1673
|
if (!parser) {
|
@@ -1621,10 +1676,10 @@
|
|
1621
1676
|
if (parser === true) {
|
1622
1677
|
return parseTokens(value);
|
1623
1678
|
}
|
1624
|
-
if (utils.isFunction(parser)) {
|
1679
|
+
if (utils$1.isFunction(parser)) {
|
1625
1680
|
return parser.call(this, value, key);
|
1626
1681
|
}
|
1627
|
-
if (utils.isRegExp(parser)) {
|
1682
|
+
if (utils$1.isRegExp(parser)) {
|
1628
1683
|
return parser.exec(value);
|
1629
1684
|
}
|
1630
1685
|
throw new TypeError('parser must be boolean|regexp|function');
|
@@ -1636,7 +1691,7 @@
|
|
1636
1691
|
value: function has(header, matcher) {
|
1637
1692
|
header = normalizeHeader(header);
|
1638
1693
|
if (header) {
|
1639
|
-
var key = utils.findKey(this, header);
|
1694
|
+
var key = utils$1.findKey(this, header);
|
1640
1695
|
return !!(key && this[key] !== undefined && (!matcher || matchHeaderValue(this, this[key], key, matcher)));
|
1641
1696
|
}
|
1642
1697
|
return false;
|
@@ -1649,14 +1704,14 @@
|
|
1649
1704
|
function deleteHeader(_header) {
|
1650
1705
|
_header = normalizeHeader(_header);
|
1651
1706
|
if (_header) {
|
1652
|
-
var key = utils.findKey(self, _header);
|
1707
|
+
var key = utils$1.findKey(self, _header);
|
1653
1708
|
if (key && (!matcher || matchHeaderValue(self, self[key], key, matcher))) {
|
1654
1709
|
delete self[key];
|
1655
1710
|
deleted = true;
|
1656
1711
|
}
|
1657
1712
|
}
|
1658
1713
|
}
|
1659
|
-
if (utils.isArray(header)) {
|
1714
|
+
if (utils$1.isArray(header)) {
|
1660
1715
|
header.forEach(deleteHeader);
|
1661
1716
|
} else {
|
1662
1717
|
deleteHeader(header);
|
@@ -1683,8 +1738,8 @@
|
|
1683
1738
|
value: function normalize(format) {
|
1684
1739
|
var self = this;
|
1685
1740
|
var headers = {};
|
1686
|
-
utils.forEach(this, function (value, header) {
|
1687
|
-
var key = utils.findKey(headers, header);
|
1741
|
+
utils$1.forEach(this, function (value, header) {
|
1742
|
+
var key = utils$1.findKey(headers, header);
|
1688
1743
|
if (key) {
|
1689
1744
|
self[key] = normalizeValue(value);
|
1690
1745
|
delete self[header];
|
@@ -1712,8 +1767,8 @@
|
|
1712
1767
|
key: "toJSON",
|
1713
1768
|
value: function toJSON(asStrings) {
|
1714
1769
|
var obj = Object.create(null);
|
1715
|
-
utils.forEach(this, function (value, header) {
|
1716
|
-
value != null && value !== false && (obj[header] = asStrings && utils.isArray(value) ? value.join(', ') : value);
|
1770
|
+
utils$1.forEach(this, function (value, header) {
|
1771
|
+
value != null && value !== false && (obj[header] = asStrings && utils$1.isArray(value) ? value.join(', ') : value);
|
1717
1772
|
});
|
1718
1773
|
return obj;
|
1719
1774
|
}
|
@@ -1769,7 +1824,7 @@
|
|
1769
1824
|
accessors[lHeader] = true;
|
1770
1825
|
}
|
1771
1826
|
}
|
1772
|
-
utils.isArray(header) ? header.forEach(defineAccessor) : defineAccessor(header);
|
1827
|
+
utils$1.isArray(header) ? header.forEach(defineAccessor) : defineAccessor(header);
|
1773
1828
|
return this;
|
1774
1829
|
}
|
1775
1830
|
}]);
|
@@ -1778,7 +1833,7 @@
|
|
1778
1833
|
AxiosHeaders.accessor(['Content-Type', 'Content-Length', 'Accept', 'Accept-Encoding', 'User-Agent', 'Authorization']);
|
1779
1834
|
|
1780
1835
|
// reserved names hotfix
|
1781
|
-
utils.reduceDescriptors(AxiosHeaders.prototype, function (_ref3, key) {
|
1836
|
+
utils$1.reduceDescriptors(AxiosHeaders.prototype, function (_ref3, key) {
|
1782
1837
|
var value = _ref3.value;
|
1783
1838
|
var mapped = key[0].toUpperCase() + key.slice(1); // map `set` => `Set`
|
1784
1839
|
return {
|
@@ -1790,7 +1845,7 @@
|
|
1790
1845
|
}
|
1791
1846
|
};
|
1792
1847
|
});
|
1793
|
-
utils.freezeMethods(AxiosHeaders);
|
1848
|
+
utils$1.freezeMethods(AxiosHeaders);
|
1794
1849
|
var AxiosHeaders$1 = AxiosHeaders;
|
1795
1850
|
|
1796
1851
|
/**
|
@@ -1806,7 +1861,7 @@
|
|
1806
1861
|
var context = response || config;
|
1807
1862
|
var headers = AxiosHeaders$1.from(context.headers);
|
1808
1863
|
var data = context.data;
|
1809
|
-
utils.forEach(fns, function transform(fn) {
|
1864
|
+
utils$1.forEach(fns, function transform(fn) {
|
1810
1865
|
data = fn.call(config, data, headers.normalize(), response ? response.status : undefined);
|
1811
1866
|
});
|
1812
1867
|
headers.normalize();
|
@@ -1831,7 +1886,7 @@
|
|
1831
1886
|
AxiosError.call(this, message == null ? 'canceled' : message, AxiosError.ERR_CANCELED, config, request);
|
1832
1887
|
this.name = 'CanceledError';
|
1833
1888
|
}
|
1834
|
-
utils.inherits(CanceledError, AxiosError, {
|
1889
|
+
utils$1.inherits(CanceledError, AxiosError, {
|
1835
1890
|
__CANCEL__: true
|
1836
1891
|
});
|
1837
1892
|
|
@@ -1853,20 +1908,20 @@
|
|
1853
1908
|
}
|
1854
1909
|
}
|
1855
1910
|
|
1856
|
-
var cookies = platform.
|
1911
|
+
var cookies = platform.hasStandardBrowserEnv ?
|
1857
1912
|
// Standard browser envs support document.cookie
|
1858
1913
|
function standardBrowserEnv() {
|
1859
1914
|
return {
|
1860
1915
|
write: function write(name, value, expires, path, domain, secure) {
|
1861
1916
|
var cookie = [];
|
1862
1917
|
cookie.push(name + '=' + encodeURIComponent(value));
|
1863
|
-
if (utils.isNumber(expires)) {
|
1918
|
+
if (utils$1.isNumber(expires)) {
|
1864
1919
|
cookie.push('expires=' + new Date(expires).toGMTString());
|
1865
1920
|
}
|
1866
|
-
if (utils.isString(path)) {
|
1921
|
+
if (utils$1.isString(path)) {
|
1867
1922
|
cookie.push('path=' + path);
|
1868
1923
|
}
|
1869
|
-
if (utils.isString(domain)) {
|
1924
|
+
if (utils$1.isString(domain)) {
|
1870
1925
|
cookie.push('domain=' + domain);
|
1871
1926
|
}
|
1872
1927
|
if (secure === true) {
|
@@ -1937,7 +1992,7 @@
|
|
1937
1992
|
return requestedURL;
|
1938
1993
|
}
|
1939
1994
|
|
1940
|
-
var isURLSameOrigin = platform.
|
1995
|
+
var isURLSameOrigin = platform.hasStandardBrowserEnv ?
|
1941
1996
|
// Standard browser envs have full support of the APIs needed to test
|
1942
1997
|
// whether the request URL is of the same origin as current location.
|
1943
1998
|
function standardBrowserEnv() {
|
@@ -1981,7 +2036,7 @@
|
|
1981
2036
|
* @returns {boolean} True if URL shares the same origin, otherwise false
|
1982
2037
|
*/
|
1983
2038
|
return function isURLSameOrigin(requestURL) {
|
1984
|
-
var parsed = utils.isString(requestURL) ? resolveURL(requestURL) : requestURL;
|
2039
|
+
var parsed = utils$1.isString(requestURL) ? resolveURL(requestURL) : requestURL;
|
1985
2040
|
return parsed.protocol === originURL.protocol && parsed.host === originURL.host;
|
1986
2041
|
};
|
1987
2042
|
}() :
|
@@ -2076,14 +2131,18 @@
|
|
2076
2131
|
}
|
2077
2132
|
}
|
2078
2133
|
var contentType;
|
2079
|
-
if (utils.isFormData(requestData)) {
|
2080
|
-
if (platform.
|
2134
|
+
if (utils$1.isFormData(requestData)) {
|
2135
|
+
if (platform.hasStandardBrowserEnv || platform.hasStandardBrowserWebWorkerEnv) {
|
2081
2136
|
requestHeaders.setContentType(false); // Let the browser set it
|
2082
|
-
} else if (
|
2083
|
-
requestHeaders.setContentType('multipart/form-data'); // mobile/desktop app frameworks
|
2084
|
-
} else if (utils.isString(contentType = requestHeaders.getContentType())) {
|
2137
|
+
} else if ((contentType = requestHeaders.getContentType()) !== false) {
|
2085
2138
|
// fix semicolon duplication issue for ReactNative FormData implementation
|
2086
|
-
|
2139
|
+
var _ref = contentType ? contentType.split(';').map(function (token) {
|
2140
|
+
return token.trim();
|
2141
|
+
}).filter(Boolean) : [],
|
2142
|
+
_ref2 = _toArray(_ref),
|
2143
|
+
type = _ref2[0],
|
2144
|
+
tokens = _ref2.slice(1);
|
2145
|
+
requestHeaders.setContentType([type || 'multipart/form-data'].concat(_toConsumableArray(tokens)).join('; '));
|
2087
2146
|
}
|
2088
2147
|
}
|
2089
2148
|
var request = new XMLHttpRequest();
|
@@ -2185,7 +2244,7 @@
|
|
2185
2244
|
// Add xsrf header
|
2186
2245
|
// This is only done if running in a standard browser environment.
|
2187
2246
|
// Specifically not if we're in a web worker, or react-native.
|
2188
|
-
if (platform.
|
2247
|
+
if (platform.hasStandardBrowserEnv) {
|
2189
2248
|
// Add xsrf header
|
2190
2249
|
// regarding CVE-2023-45857 config.withCredentials condition was removed temporarily
|
2191
2250
|
var xsrfValue = isURLSameOrigin(fullPath) && config.xsrfCookieName && cookies.read(config.xsrfCookieName);
|
@@ -2199,13 +2258,13 @@
|
|
2199
2258
|
|
2200
2259
|
// Add headers to the request
|
2201
2260
|
if ('setRequestHeader' in request) {
|
2202
|
-
utils.forEach(requestHeaders.toJSON(), function setRequestHeader(val, key) {
|
2261
|
+
utils$1.forEach(requestHeaders.toJSON(), function setRequestHeader(val, key) {
|
2203
2262
|
request.setRequestHeader(key, val);
|
2204
2263
|
});
|
2205
2264
|
}
|
2206
2265
|
|
2207
2266
|
// Add withCredentials to request if needed
|
2208
|
-
if (!utils.isUndefined(config.withCredentials)) {
|
2267
|
+
if (!utils$1.isUndefined(config.withCredentials)) {
|
2209
2268
|
request.withCredentials = !!config.withCredentials;
|
2210
2269
|
}
|
2211
2270
|
|
@@ -2254,7 +2313,7 @@
|
|
2254
2313
|
http: httpAdapter,
|
2255
2314
|
xhr: xhrAdapter
|
2256
2315
|
};
|
2257
|
-
utils.forEach(knownAdapters, function (fn, value) {
|
2316
|
+
utils$1.forEach(knownAdapters, function (fn, value) {
|
2258
2317
|
if (fn) {
|
2259
2318
|
try {
|
2260
2319
|
Object.defineProperty(fn, 'name', {
|
@@ -2272,11 +2331,11 @@
|
|
2272
2331
|
return "- ".concat(reason);
|
2273
2332
|
};
|
2274
2333
|
var isResolvedHandle = function isResolvedHandle(adapter) {
|
2275
|
-
return utils.isFunction(adapter) || adapter === null || adapter === false;
|
2334
|
+
return utils$1.isFunction(adapter) || adapter === null || adapter === false;
|
2276
2335
|
};
|
2277
2336
|
var adapters = {
|
2278
2337
|
getAdapter: function getAdapter(adapters) {
|
2279
|
-
adapters = utils.isArray(adapters) ? adapters : [adapters];
|
2338
|
+
adapters = utils$1.isArray(adapters) ? adapters : [adapters];
|
2280
2339
|
var _adapters = adapters,
|
2281
2340
|
length = _adapters.length;
|
2282
2341
|
var nameOrAdapter;
|
@@ -2384,13 +2443,13 @@
|
|
2384
2443
|
config2 = config2 || {};
|
2385
2444
|
var config = {};
|
2386
2445
|
function getMergedValue(target, source, caseless) {
|
2387
|
-
if (utils.isPlainObject(target) && utils.isPlainObject(source)) {
|
2388
|
-
return utils.merge.call({
|
2446
|
+
if (utils$1.isPlainObject(target) && utils$1.isPlainObject(source)) {
|
2447
|
+
return utils$1.merge.call({
|
2389
2448
|
caseless: caseless
|
2390
2449
|
}, target, source);
|
2391
|
-
} else if (utils.isPlainObject(source)) {
|
2392
|
-
return utils.merge({}, source);
|
2393
|
-
} else if (utils.isArray(source)) {
|
2450
|
+
} else if (utils$1.isPlainObject(source)) {
|
2451
|
+
return utils$1.merge({}, source);
|
2452
|
+
} else if (utils$1.isArray(source)) {
|
2394
2453
|
return source.slice();
|
2395
2454
|
}
|
2396
2455
|
return source;
|
@@ -2398,25 +2457,25 @@
|
|
2398
2457
|
|
2399
2458
|
// eslint-disable-next-line consistent-return
|
2400
2459
|
function mergeDeepProperties(a, b, caseless) {
|
2401
|
-
if (!utils.isUndefined(b)) {
|
2460
|
+
if (!utils$1.isUndefined(b)) {
|
2402
2461
|
return getMergedValue(a, b, caseless);
|
2403
|
-
} else if (!utils.isUndefined(a)) {
|
2462
|
+
} else if (!utils$1.isUndefined(a)) {
|
2404
2463
|
return getMergedValue(undefined, a, caseless);
|
2405
2464
|
}
|
2406
2465
|
}
|
2407
2466
|
|
2408
2467
|
// eslint-disable-next-line consistent-return
|
2409
2468
|
function valueFromConfig2(a, b) {
|
2410
|
-
if (!utils.isUndefined(b)) {
|
2469
|
+
if (!utils$1.isUndefined(b)) {
|
2411
2470
|
return getMergedValue(undefined, b);
|
2412
2471
|
}
|
2413
2472
|
}
|
2414
2473
|
|
2415
2474
|
// eslint-disable-next-line consistent-return
|
2416
2475
|
function defaultToConfig2(a, b) {
|
2417
|
-
if (!utils.isUndefined(b)) {
|
2476
|
+
if (!utils$1.isUndefined(b)) {
|
2418
2477
|
return getMergedValue(undefined, b);
|
2419
|
-
} else if (!utils.isUndefined(a)) {
|
2478
|
+
} else if (!utils$1.isUndefined(a)) {
|
2420
2479
|
return getMergedValue(undefined, a);
|
2421
2480
|
}
|
2422
2481
|
}
|
@@ -2461,15 +2520,15 @@
|
|
2461
2520
|
return mergeDeepProperties(headersToObject(a), headersToObject(b), true);
|
2462
2521
|
}
|
2463
2522
|
};
|
2464
|
-
utils.forEach(Object.keys(Object.assign({}, config1, config2)), function computeConfigValue(prop) {
|
2523
|
+
utils$1.forEach(Object.keys(Object.assign({}, config1, config2)), function computeConfigValue(prop) {
|
2465
2524
|
var merge = mergeMap[prop] || mergeDeepProperties;
|
2466
2525
|
var configValue = merge(config1[prop], config2[prop], prop);
|
2467
|
-
utils.isUndefined(configValue) && merge !== mergeDirectKeys || (config[prop] = configValue);
|
2526
|
+
utils$1.isUndefined(configValue) && merge !== mergeDirectKeys || (config[prop] = configValue);
|
2468
2527
|
});
|
2469
2528
|
return config;
|
2470
2529
|
}
|
2471
2530
|
|
2472
|
-
var VERSION = "1.6.
|
2531
|
+
var VERSION = "1.6.1";
|
2473
2532
|
|
2474
2533
|
var validators$1 = {};
|
2475
2534
|
|
@@ -2597,7 +2656,7 @@
|
|
2597
2656
|
}, false);
|
2598
2657
|
}
|
2599
2658
|
if (paramsSerializer != null) {
|
2600
|
-
if (utils.isFunction(paramsSerializer)) {
|
2659
|
+
if (utils$1.isFunction(paramsSerializer)) {
|
2601
2660
|
config.paramsSerializer = {
|
2602
2661
|
serialize: paramsSerializer
|
2603
2662
|
};
|
@@ -2613,8 +2672,8 @@
|
|
2613
2672
|
config.method = (config.method || this.defaults.method || 'get').toLowerCase();
|
2614
2673
|
|
2615
2674
|
// Flatten headers
|
2616
|
-
var contextHeaders = headers && utils.merge(headers.common, headers[config.method]);
|
2617
|
-
headers && utils.forEach(['delete', 'get', 'head', 'post', 'put', 'patch', 'common'], function (method) {
|
2675
|
+
var contextHeaders = headers && utils$1.merge(headers.common, headers[config.method]);
|
2676
|
+
headers && utils$1.forEach(['delete', 'get', 'head', 'post', 'put', 'patch', 'common'], function (method) {
|
2618
2677
|
delete headers[method];
|
2619
2678
|
});
|
2620
2679
|
config.headers = AxiosHeaders$1.concat(contextHeaders, headers);
|
@@ -2682,7 +2741,7 @@
|
|
2682
2741
|
}]);
|
2683
2742
|
return Axios;
|
2684
2743
|
}(); // Provide aliases for supported request methods
|
2685
|
-
utils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {
|
2744
|
+
utils$1.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {
|
2686
2745
|
/*eslint func-names:0*/
|
2687
2746
|
Axios.prototype[method] = function (url, config) {
|
2688
2747
|
return this.request(mergeConfig(config || {}, {
|
@@ -2692,7 +2751,7 @@
|
|
2692
2751
|
}));
|
2693
2752
|
};
|
2694
2753
|
});
|
2695
|
-
utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {
|
2754
|
+
utils$1.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {
|
2696
2755
|
/*eslint func-names:0*/
|
2697
2756
|
|
2698
2757
|
function generateHTTPMethod(isForm) {
|
@@ -2863,7 +2922,7 @@
|
|
2863
2922
|
* @returns {boolean} True if the payload is an error thrown by Axios, otherwise false
|
2864
2923
|
*/
|
2865
2924
|
function isAxiosError(payload) {
|
2866
|
-
return utils.isObject(payload) && payload.isAxiosError === true;
|
2925
|
+
return utils$1.isObject(payload) && payload.isAxiosError === true;
|
2867
2926
|
}
|
2868
2927
|
|
2869
2928
|
var HttpStatusCode = {
|
@@ -2951,12 +3010,12 @@
|
|
2951
3010
|
var instance = bind(Axios$1.prototype.request, context);
|
2952
3011
|
|
2953
3012
|
// Copy axios.prototype to instance
|
2954
|
-
utils.extend(instance, Axios$1.prototype, context, {
|
3013
|
+
utils$1.extend(instance, Axios$1.prototype, context, {
|
2955
3014
|
allOwnKeys: true
|
2956
3015
|
});
|
2957
3016
|
|
2958
3017
|
// Copy context to instance
|
2959
|
-
utils.extend(instance, context, null, {
|
3018
|
+
utils$1.extend(instance, context, null, {
|
2960
3019
|
allOwnKeys: true
|
2961
3020
|
});
|
2962
3021
|
|
@@ -2999,7 +3058,7 @@
|
|
2999
3058
|
axios.mergeConfig = mergeConfig;
|
3000
3059
|
axios.AxiosHeaders = AxiosHeaders$1;
|
3001
3060
|
axios.formToJSON = function (thing) {
|
3002
|
-
return formDataToJSON(utils.isHTMLForm(thing) ? new FormData(thing) : thing);
|
3061
|
+
return formDataToJSON(utils$1.isHTMLForm(thing) ? new FormData(thing) : thing);
|
3003
3062
|
};
|
3004
3063
|
axios.getAdapter = adapters.getAdapter;
|
3005
3064
|
axios.HttpStatusCode = HttpStatusCode$1;
|