axios 1.6.0 → 1.6.2
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 +44 -0
- package/README.md +5 -2
- package/dist/axios.js +222 -172
- 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 +177 -180
- package/dist/browser/axios.cjs.map +1 -1
- package/dist/esm/axios.js +177 -180
- 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 +240 -192
- package/dist/node/axios.cjs.map +1 -1
- package/index.d.cts +1 -0
- package/index.d.ts +1 -0
- package/lib/adapters/xhr.js +14 -12
- package/lib/core/mergeConfig.js +1 -0
- package/lib/env/data.js +1 -1
- package/lib/helpers/cookies.js +39 -49
- package/lib/helpers/isURLSameOrigin.js +2 -2
- 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.2 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,46 +1908,33 @@
|
|
1853
1908
|
}
|
1854
1909
|
}
|
1855
1910
|
|
1856
|
-
var cookies = platform.
|
1911
|
+
var cookies = platform.hasStandardBrowserEnv ?
|
1857
1912
|
// Standard browser envs support document.cookie
|
1858
|
-
|
1859
|
-
|
1860
|
-
|
1861
|
-
|
1862
|
-
|
1863
|
-
|
1864
|
-
|
1865
|
-
|
1866
|
-
|
1867
|
-
|
1868
|
-
|
1869
|
-
|
1870
|
-
|
1871
|
-
|
1872
|
-
|
1873
|
-
|
1874
|
-
|
1875
|
-
|
1876
|
-
|
1877
|
-
|
1878
|
-
|
1879
|
-
|
1880
|
-
|
1881
|
-
|
1882
|
-
|
1883
|
-
}
|
1884
|
-
};
|
1885
|
-
}() :
|
1886
|
-
// Non standard browser env (web workers, react-native) lack needed support.
|
1887
|
-
function nonStandardBrowserEnv() {
|
1888
|
-
return {
|
1889
|
-
write: function write() {},
|
1890
|
-
read: function read() {
|
1891
|
-
return null;
|
1892
|
-
},
|
1893
|
-
remove: function remove() {}
|
1894
|
-
};
|
1895
|
-
}();
|
1913
|
+
{
|
1914
|
+
write: function write(name, value, expires, path, domain, secure) {
|
1915
|
+
var cookie = [name + '=' + encodeURIComponent(value)];
|
1916
|
+
utils$1.isNumber(expires) && cookie.push('expires=' + new Date(expires).toGMTString());
|
1917
|
+
utils$1.isString(path) && cookie.push('path=' + path);
|
1918
|
+
utils$1.isString(domain) && cookie.push('domain=' + domain);
|
1919
|
+
secure === true && cookie.push('secure');
|
1920
|
+
document.cookie = cookie.join('; ');
|
1921
|
+
},
|
1922
|
+
read: function read(name) {
|
1923
|
+
var match = document.cookie.match(new RegExp('(^|;\\s*)(' + name + ')=([^;]*)'));
|
1924
|
+
return match ? decodeURIComponent(match[3]) : null;
|
1925
|
+
},
|
1926
|
+
remove: function remove(name) {
|
1927
|
+
this.write(name, '', Date.now() - 86400000);
|
1928
|
+
}
|
1929
|
+
} :
|
1930
|
+
// Non-standard browser env (web workers, react-native) lack needed support.
|
1931
|
+
{
|
1932
|
+
write: function write() {},
|
1933
|
+
read: function read() {
|
1934
|
+
return null;
|
1935
|
+
},
|
1936
|
+
remove: function remove() {}
|
1937
|
+
};
|
1896
1938
|
|
1897
1939
|
/**
|
1898
1940
|
* Determines whether the specified URL is absolute
|
@@ -1937,7 +1979,7 @@
|
|
1937
1979
|
return requestedURL;
|
1938
1980
|
}
|
1939
1981
|
|
1940
|
-
var isURLSameOrigin = platform.
|
1982
|
+
var isURLSameOrigin = platform.hasStandardBrowserEnv ?
|
1941
1983
|
// Standard browser envs have full support of the APIs needed to test
|
1942
1984
|
// whether the request URL is of the same origin as current location.
|
1943
1985
|
function standardBrowserEnv() {
|
@@ -1946,7 +1988,7 @@
|
|
1946
1988
|
var originURL;
|
1947
1989
|
|
1948
1990
|
/**
|
1949
|
-
* Parse a URL to discover
|
1991
|
+
* Parse a URL to discover its components
|
1950
1992
|
*
|
1951
1993
|
* @param {String} url The URL to be parsed
|
1952
1994
|
* @returns {Object}
|
@@ -1981,7 +2023,7 @@
|
|
1981
2023
|
* @returns {boolean} True if URL shares the same origin, otherwise false
|
1982
2024
|
*/
|
1983
2025
|
return function isURLSameOrigin(requestURL) {
|
1984
|
-
var parsed = utils.isString(requestURL) ? resolveURL(requestURL) : requestURL;
|
2026
|
+
var parsed = utils$1.isString(requestURL) ? resolveURL(requestURL) : requestURL;
|
1985
2027
|
return parsed.protocol === originURL.protocol && parsed.host === originURL.host;
|
1986
2028
|
};
|
1987
2029
|
}() :
|
@@ -2065,7 +2107,8 @@
|
|
2065
2107
|
return new Promise(function dispatchXhrRequest(resolve, reject) {
|
2066
2108
|
var requestData = config.data;
|
2067
2109
|
var requestHeaders = AxiosHeaders$1.from(config.headers).normalize();
|
2068
|
-
var responseType = config.responseType
|
2110
|
+
var responseType = config.responseType,
|
2111
|
+
withXSRFToken = config.withXSRFToken;
|
2069
2112
|
var onCanceled;
|
2070
2113
|
function done() {
|
2071
2114
|
if (config.cancelToken) {
|
@@ -2076,14 +2119,18 @@
|
|
2076
2119
|
}
|
2077
2120
|
}
|
2078
2121
|
var contentType;
|
2079
|
-
if (utils.isFormData(requestData)) {
|
2080
|
-
if (platform.
|
2122
|
+
if (utils$1.isFormData(requestData)) {
|
2123
|
+
if (platform.hasStandardBrowserEnv || platform.hasStandardBrowserWebWorkerEnv) {
|
2081
2124
|
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())) {
|
2125
|
+
} else if ((contentType = requestHeaders.getContentType()) !== false) {
|
2085
2126
|
// fix semicolon duplication issue for ReactNative FormData implementation
|
2086
|
-
|
2127
|
+
var _ref = contentType ? contentType.split(';').map(function (token) {
|
2128
|
+
return token.trim();
|
2129
|
+
}).filter(Boolean) : [],
|
2130
|
+
_ref2 = _toArray(_ref),
|
2131
|
+
type = _ref2[0],
|
2132
|
+
tokens = _ref2.slice(1);
|
2133
|
+
requestHeaders.setContentType([type || 'multipart/form-data'].concat(_toConsumableArray(tokens)).join('; '));
|
2087
2134
|
}
|
2088
2135
|
}
|
2089
2136
|
var request = new XMLHttpRequest();
|
@@ -2185,12 +2232,14 @@
|
|
2185
2232
|
// Add xsrf header
|
2186
2233
|
// This is only done if running in a standard browser environment.
|
2187
2234
|
// Specifically not if we're in a web worker, or react-native.
|
2188
|
-
if (platform.
|
2189
|
-
|
2190
|
-
|
2191
|
-
|
2192
|
-
|
2193
|
-
|
2235
|
+
if (platform.hasStandardBrowserEnv) {
|
2236
|
+
withXSRFToken && utils$1.isFunction(withXSRFToken) && (withXSRFToken = withXSRFToken(config));
|
2237
|
+
if (withXSRFToken || withXSRFToken !== false && isURLSameOrigin(fullPath)) {
|
2238
|
+
// Add xsrf header
|
2239
|
+
var xsrfValue = config.xsrfHeaderName && config.xsrfCookieName && cookies.read(config.xsrfCookieName);
|
2240
|
+
if (xsrfValue) {
|
2241
|
+
requestHeaders.set(config.xsrfHeaderName, xsrfValue);
|
2242
|
+
}
|
2194
2243
|
}
|
2195
2244
|
}
|
2196
2245
|
|
@@ -2199,13 +2248,13 @@
|
|
2199
2248
|
|
2200
2249
|
// Add headers to the request
|
2201
2250
|
if ('setRequestHeader' in request) {
|
2202
|
-
utils.forEach(requestHeaders.toJSON(), function setRequestHeader(val, key) {
|
2251
|
+
utils$1.forEach(requestHeaders.toJSON(), function setRequestHeader(val, key) {
|
2203
2252
|
request.setRequestHeader(key, val);
|
2204
2253
|
});
|
2205
2254
|
}
|
2206
2255
|
|
2207
2256
|
// Add withCredentials to request if needed
|
2208
|
-
if (!utils.isUndefined(config.withCredentials)) {
|
2257
|
+
if (!utils$1.isUndefined(config.withCredentials)) {
|
2209
2258
|
request.withCredentials = !!config.withCredentials;
|
2210
2259
|
}
|
2211
2260
|
|
@@ -2254,7 +2303,7 @@
|
|
2254
2303
|
http: httpAdapter,
|
2255
2304
|
xhr: xhrAdapter
|
2256
2305
|
};
|
2257
|
-
utils.forEach(knownAdapters, function (fn, value) {
|
2306
|
+
utils$1.forEach(knownAdapters, function (fn, value) {
|
2258
2307
|
if (fn) {
|
2259
2308
|
try {
|
2260
2309
|
Object.defineProperty(fn, 'name', {
|
@@ -2272,11 +2321,11 @@
|
|
2272
2321
|
return "- ".concat(reason);
|
2273
2322
|
};
|
2274
2323
|
var isResolvedHandle = function isResolvedHandle(adapter) {
|
2275
|
-
return utils.isFunction(adapter) || adapter === null || adapter === false;
|
2324
|
+
return utils$1.isFunction(adapter) || adapter === null || adapter === false;
|
2276
2325
|
};
|
2277
2326
|
var adapters = {
|
2278
2327
|
getAdapter: function getAdapter(adapters) {
|
2279
|
-
adapters = utils.isArray(adapters) ? adapters : [adapters];
|
2328
|
+
adapters = utils$1.isArray(adapters) ? adapters : [adapters];
|
2280
2329
|
var _adapters = adapters,
|
2281
2330
|
length = _adapters.length;
|
2282
2331
|
var nameOrAdapter;
|
@@ -2384,13 +2433,13 @@
|
|
2384
2433
|
config2 = config2 || {};
|
2385
2434
|
var config = {};
|
2386
2435
|
function getMergedValue(target, source, caseless) {
|
2387
|
-
if (utils.isPlainObject(target) && utils.isPlainObject(source)) {
|
2388
|
-
return utils.merge.call({
|
2436
|
+
if (utils$1.isPlainObject(target) && utils$1.isPlainObject(source)) {
|
2437
|
+
return utils$1.merge.call({
|
2389
2438
|
caseless: caseless
|
2390
2439
|
}, target, source);
|
2391
|
-
} else if (utils.isPlainObject(source)) {
|
2392
|
-
return utils.merge({}, source);
|
2393
|
-
} else if (utils.isArray(source)) {
|
2440
|
+
} else if (utils$1.isPlainObject(source)) {
|
2441
|
+
return utils$1.merge({}, source);
|
2442
|
+
} else if (utils$1.isArray(source)) {
|
2394
2443
|
return source.slice();
|
2395
2444
|
}
|
2396
2445
|
return source;
|
@@ -2398,25 +2447,25 @@
|
|
2398
2447
|
|
2399
2448
|
// eslint-disable-next-line consistent-return
|
2400
2449
|
function mergeDeepProperties(a, b, caseless) {
|
2401
|
-
if (!utils.isUndefined(b)) {
|
2450
|
+
if (!utils$1.isUndefined(b)) {
|
2402
2451
|
return getMergedValue(a, b, caseless);
|
2403
|
-
} else if (!utils.isUndefined(a)) {
|
2452
|
+
} else if (!utils$1.isUndefined(a)) {
|
2404
2453
|
return getMergedValue(undefined, a, caseless);
|
2405
2454
|
}
|
2406
2455
|
}
|
2407
2456
|
|
2408
2457
|
// eslint-disable-next-line consistent-return
|
2409
2458
|
function valueFromConfig2(a, b) {
|
2410
|
-
if (!utils.isUndefined(b)) {
|
2459
|
+
if (!utils$1.isUndefined(b)) {
|
2411
2460
|
return getMergedValue(undefined, b);
|
2412
2461
|
}
|
2413
2462
|
}
|
2414
2463
|
|
2415
2464
|
// eslint-disable-next-line consistent-return
|
2416
2465
|
function defaultToConfig2(a, b) {
|
2417
|
-
if (!utils.isUndefined(b)) {
|
2466
|
+
if (!utils$1.isUndefined(b)) {
|
2418
2467
|
return getMergedValue(undefined, b);
|
2419
|
-
} else if (!utils.isUndefined(a)) {
|
2468
|
+
} else if (!utils$1.isUndefined(a)) {
|
2420
2469
|
return getMergedValue(undefined, a);
|
2421
2470
|
}
|
2422
2471
|
}
|
@@ -2440,6 +2489,7 @@
|
|
2440
2489
|
timeout: defaultToConfig2,
|
2441
2490
|
timeoutMessage: defaultToConfig2,
|
2442
2491
|
withCredentials: defaultToConfig2,
|
2492
|
+
withXSRFToken: defaultToConfig2,
|
2443
2493
|
adapter: defaultToConfig2,
|
2444
2494
|
responseType: defaultToConfig2,
|
2445
2495
|
xsrfCookieName: defaultToConfig2,
|
@@ -2461,15 +2511,15 @@
|
|
2461
2511
|
return mergeDeepProperties(headersToObject(a), headersToObject(b), true);
|
2462
2512
|
}
|
2463
2513
|
};
|
2464
|
-
utils.forEach(Object.keys(Object.assign({}, config1, config2)), function computeConfigValue(prop) {
|
2514
|
+
utils$1.forEach(Object.keys(Object.assign({}, config1, config2)), function computeConfigValue(prop) {
|
2465
2515
|
var merge = mergeMap[prop] || mergeDeepProperties;
|
2466
2516
|
var configValue = merge(config1[prop], config2[prop], prop);
|
2467
|
-
utils.isUndefined(configValue) && merge !== mergeDirectKeys || (config[prop] = configValue);
|
2517
|
+
utils$1.isUndefined(configValue) && merge !== mergeDirectKeys || (config[prop] = configValue);
|
2468
2518
|
});
|
2469
2519
|
return config;
|
2470
2520
|
}
|
2471
2521
|
|
2472
|
-
var VERSION = "1.6.
|
2522
|
+
var VERSION = "1.6.2";
|
2473
2523
|
|
2474
2524
|
var validators$1 = {};
|
2475
2525
|
|
@@ -2597,7 +2647,7 @@
|
|
2597
2647
|
}, false);
|
2598
2648
|
}
|
2599
2649
|
if (paramsSerializer != null) {
|
2600
|
-
if (utils.isFunction(paramsSerializer)) {
|
2650
|
+
if (utils$1.isFunction(paramsSerializer)) {
|
2601
2651
|
config.paramsSerializer = {
|
2602
2652
|
serialize: paramsSerializer
|
2603
2653
|
};
|
@@ -2613,8 +2663,8 @@
|
|
2613
2663
|
config.method = (config.method || this.defaults.method || 'get').toLowerCase();
|
2614
2664
|
|
2615
2665
|
// 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) {
|
2666
|
+
var contextHeaders = headers && utils$1.merge(headers.common, headers[config.method]);
|
2667
|
+
headers && utils$1.forEach(['delete', 'get', 'head', 'post', 'put', 'patch', 'common'], function (method) {
|
2618
2668
|
delete headers[method];
|
2619
2669
|
});
|
2620
2670
|
config.headers = AxiosHeaders$1.concat(contextHeaders, headers);
|
@@ -2682,7 +2732,7 @@
|
|
2682
2732
|
}]);
|
2683
2733
|
return Axios;
|
2684
2734
|
}(); // Provide aliases for supported request methods
|
2685
|
-
utils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {
|
2735
|
+
utils$1.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {
|
2686
2736
|
/*eslint func-names:0*/
|
2687
2737
|
Axios.prototype[method] = function (url, config) {
|
2688
2738
|
return this.request(mergeConfig(config || {}, {
|
@@ -2692,7 +2742,7 @@
|
|
2692
2742
|
}));
|
2693
2743
|
};
|
2694
2744
|
});
|
2695
|
-
utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {
|
2745
|
+
utils$1.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {
|
2696
2746
|
/*eslint func-names:0*/
|
2697
2747
|
|
2698
2748
|
function generateHTTPMethod(isForm) {
|
@@ -2863,7 +2913,7 @@
|
|
2863
2913
|
* @returns {boolean} True if the payload is an error thrown by Axios, otherwise false
|
2864
2914
|
*/
|
2865
2915
|
function isAxiosError(payload) {
|
2866
|
-
return utils.isObject(payload) && payload.isAxiosError === true;
|
2916
|
+
return utils$1.isObject(payload) && payload.isAxiosError === true;
|
2867
2917
|
}
|
2868
2918
|
|
2869
2919
|
var HttpStatusCode = {
|
@@ -2951,12 +3001,12 @@
|
|
2951
3001
|
var instance = bind(Axios$1.prototype.request, context);
|
2952
3002
|
|
2953
3003
|
// Copy axios.prototype to instance
|
2954
|
-
utils.extend(instance, Axios$1.prototype, context, {
|
3004
|
+
utils$1.extend(instance, Axios$1.prototype, context, {
|
2955
3005
|
allOwnKeys: true
|
2956
3006
|
});
|
2957
3007
|
|
2958
3008
|
// Copy context to instance
|
2959
|
-
utils.extend(instance, context, null, {
|
3009
|
+
utils$1.extend(instance, context, null, {
|
2960
3010
|
allOwnKeys: true
|
2961
3011
|
});
|
2962
3012
|
|
@@ -2999,7 +3049,7 @@
|
|
2999
3049
|
axios.mergeConfig = mergeConfig;
|
3000
3050
|
axios.AxiosHeaders = AxiosHeaders$1;
|
3001
3051
|
axios.formToJSON = function (thing) {
|
3002
|
-
return formDataToJSON(utils.isHTMLForm(thing) ? new FormData(thing) : thing);
|
3052
|
+
return formDataToJSON(utils$1.isHTMLForm(thing) ? new FormData(thing) : thing);
|
3003
3053
|
};
|
3004
3054
|
axios.getAdapter = adapters.getAdapter;
|
3005
3055
|
axios.HttpStatusCode = HttpStatusCode$1;
|