mirror of
https://github.com/tenrok/axios.git
synced 2026-06-23 20:40:40 +03:00
Releasing 0.20.0-0
This commit is contained in:
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "axios",
|
"name": "axios",
|
||||||
"main": "./dist/axios.js",
|
"main": "./dist/axios.js",
|
||||||
"version": "0.19.2",
|
"version": "0.20.0-0",
|
||||||
"homepage": "https://github.com/axios/axios",
|
"homepage": "https://github.com/axios/axios",
|
||||||
"authors": [
|
"authors": [
|
||||||
"Matt Zabriskie"
|
"Matt Zabriskie"
|
||||||
|
|||||||
Vendored
+167
-139
@@ -1,3 +1,4 @@
|
|||||||
|
/* axios v0.20.0-0 | (c) 2020 by Matt Zabriskie */
|
||||||
(function webpackUniversalModuleDefinition(root, factory) {
|
(function webpackUniversalModuleDefinition(root, factory) {
|
||||||
if(typeof exports === 'object' && typeof module === 'object')
|
if(typeof exports === 'object' && typeof module === 'object')
|
||||||
module.exports = factory();
|
module.exports = factory();
|
||||||
@@ -226,6 +227,21 @@ return /******/ (function(modules) { // webpackBootstrap
|
|||||||
return val !== null && typeof val === 'object';
|
return val !== null && typeof val === 'object';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Determine if a value is a plain Object
|
||||||
|
*
|
||||||
|
* @param {Object} val The value to test
|
||||||
|
* @return {boolean} True if value is a plain Object, otherwise false
|
||||||
|
*/
|
||||||
|
function isPlainObject(val) {
|
||||||
|
if (toString.call(val) !== '[object Object]') {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
var prototype = Object.getPrototypeOf(val);
|
||||||
|
return prototype === null || prototype === Object.prototype;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Determine if a value is a Date
|
* Determine if a value is a Date
|
||||||
*
|
*
|
||||||
@@ -382,34 +398,12 @@ return /******/ (function(modules) { // webpackBootstrap
|
|||||||
function merge(/* obj1, obj2, obj3, ... */) {
|
function merge(/* obj1, obj2, obj3, ... */) {
|
||||||
var result = {};
|
var result = {};
|
||||||
function assignValue(val, key) {
|
function assignValue(val, key) {
|
||||||
if (typeof result[key] === 'object' && typeof val === 'object') {
|
if (isPlainObject(result[key]) && isPlainObject(val)) {
|
||||||
result[key] = merge(result[key], val);
|
result[key] = merge(result[key], val);
|
||||||
} else {
|
} else if (isPlainObject(val)) {
|
||||||
result[key] = val;
|
result[key] = merge({}, val);
|
||||||
}
|
} else if (isArray(val)) {
|
||||||
}
|
result[key] = val.slice();
|
||||||
|
|
||||||
for (var i = 0, l = arguments.length; i < l; i++) {
|
|
||||||
forEach(arguments[i], assignValue);
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Function equal to merge with the difference being that no reference
|
|
||||||
* to original objects is kept.
|
|
||||||
*
|
|
||||||
* @see merge
|
|
||||||
* @param {Object} obj1 Object to merge
|
|
||||||
* @returns {Object} Result of all merge properties
|
|
||||||
*/
|
|
||||||
function deepMerge(/* obj1, obj2, obj3, ... */) {
|
|
||||||
var result = {};
|
|
||||||
function assignValue(val, key) {
|
|
||||||
if (typeof result[key] === 'object' && typeof val === 'object') {
|
|
||||||
result[key] = deepMerge(result[key], val);
|
|
||||||
} else if (typeof val === 'object') {
|
|
||||||
result[key] = deepMerge({}, val);
|
|
||||||
} else {
|
} else {
|
||||||
result[key] = val;
|
result[key] = val;
|
||||||
}
|
}
|
||||||
@@ -440,6 +434,19 @@ return /******/ (function(modules) { // webpackBootstrap
|
|||||||
return a;
|
return a;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Remove byte order marker. This catches EF BB BF (the UTF-8 BOM)
|
||||||
|
*
|
||||||
|
* @param {string} content with BOM
|
||||||
|
* @return {string} content value without BOM
|
||||||
|
*/
|
||||||
|
function stripBOM(content) {
|
||||||
|
if (content.charCodeAt(0) === 0xFEFF) {
|
||||||
|
content = content.slice(1);
|
||||||
|
}
|
||||||
|
return content;
|
||||||
|
}
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
isArray: isArray,
|
isArray: isArray,
|
||||||
isArrayBuffer: isArrayBuffer,
|
isArrayBuffer: isArrayBuffer,
|
||||||
@@ -449,6 +456,7 @@ return /******/ (function(modules) { // webpackBootstrap
|
|||||||
isString: isString,
|
isString: isString,
|
||||||
isNumber: isNumber,
|
isNumber: isNumber,
|
||||||
isObject: isObject,
|
isObject: isObject,
|
||||||
|
isPlainObject: isPlainObject,
|
||||||
isUndefined: isUndefined,
|
isUndefined: isUndefined,
|
||||||
isDate: isDate,
|
isDate: isDate,
|
||||||
isFile: isFile,
|
isFile: isFile,
|
||||||
@@ -459,9 +467,9 @@ return /******/ (function(modules) { // webpackBootstrap
|
|||||||
isStandardBrowserEnv: isStandardBrowserEnv,
|
isStandardBrowserEnv: isStandardBrowserEnv,
|
||||||
forEach: forEach,
|
forEach: forEach,
|
||||||
merge: merge,
|
merge: merge,
|
||||||
deepMerge: deepMerge,
|
|
||||||
extend: extend,
|
extend: extend,
|
||||||
trim: trim
|
trim: trim,
|
||||||
|
stripBOM: stripBOM
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@@ -561,7 +569,7 @@ return /******/ (function(modules) { // webpackBootstrap
|
|||||||
utils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {
|
utils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {
|
||||||
/*eslint func-names:0*/
|
/*eslint func-names:0*/
|
||||||
Axios.prototype[method] = function(url, config) {
|
Axios.prototype[method] = function(url, config) {
|
||||||
return this.request(utils.merge(config || {}, {
|
return this.request(mergeConfig(config || {}, {
|
||||||
method: method,
|
method: method,
|
||||||
url: url
|
url: url
|
||||||
}));
|
}));
|
||||||
@@ -571,7 +579,7 @@ return /******/ (function(modules) { // webpackBootstrap
|
|||||||
utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {
|
utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {
|
||||||
/*eslint func-names:0*/
|
/*eslint func-names:0*/
|
||||||
Axios.prototype[method] = function(url, data, config) {
|
Axios.prototype[method] = function(url, data, config) {
|
||||||
return this.request(utils.merge(config || {}, {
|
return this.request(mergeConfig(config || {}, {
|
||||||
method: method,
|
method: method,
|
||||||
url: url,
|
url: url,
|
||||||
data: data
|
data: data
|
||||||
@@ -592,7 +600,6 @@ return /******/ (function(modules) { // webpackBootstrap
|
|||||||
|
|
||||||
function encode(val) {
|
function encode(val) {
|
||||||
return encodeURIComponent(val).
|
return encodeURIComponent(val).
|
||||||
replace(/%40/gi, '@').
|
|
||||||
replace(/%3A/gi, ':').
|
replace(/%3A/gi, ':').
|
||||||
replace(/%24/g, '$').
|
replace(/%24/g, '$').
|
||||||
replace(/%2C/gi, ',').
|
replace(/%2C/gi, ',').
|
||||||
@@ -919,6 +926,7 @@ return /******/ (function(modules) { // webpackBootstrap
|
|||||||
xsrfHeaderName: 'X-XSRF-TOKEN',
|
xsrfHeaderName: 'X-XSRF-TOKEN',
|
||||||
|
|
||||||
maxContentLength: -1,
|
maxContentLength: -1,
|
||||||
|
maxBodyLength: -1,
|
||||||
|
|
||||||
validateStatus: function validateStatus(status) {
|
validateStatus: function validateStatus(status) {
|
||||||
return status >= 200 && status < 300;
|
return status >= 200 && status < 300;
|
||||||
@@ -968,10 +976,11 @@ return /******/ (function(modules) { // webpackBootstrap
|
|||||||
|
|
||||||
var utils = __webpack_require__(2);
|
var utils = __webpack_require__(2);
|
||||||
var settle = __webpack_require__(13);
|
var settle = __webpack_require__(13);
|
||||||
|
var cookies = __webpack_require__(16);
|
||||||
var buildURL = __webpack_require__(5);
|
var buildURL = __webpack_require__(5);
|
||||||
var buildFullPath = __webpack_require__(16);
|
var buildFullPath = __webpack_require__(17);
|
||||||
var parseHeaders = __webpack_require__(19);
|
var parseHeaders = __webpack_require__(20);
|
||||||
var isURLSameOrigin = __webpack_require__(20);
|
var isURLSameOrigin = __webpack_require__(21);
|
||||||
var createError = __webpack_require__(14);
|
var createError = __webpack_require__(14);
|
||||||
|
|
||||||
module.exports = function xhrAdapter(config) {
|
module.exports = function xhrAdapter(config) {
|
||||||
@@ -983,12 +992,19 @@ return /******/ (function(modules) { // webpackBootstrap
|
|||||||
delete requestHeaders['Content-Type']; // Let the browser set it
|
delete requestHeaders['Content-Type']; // Let the browser set it
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (
|
||||||
|
(utils.isBlob(requestData) || utils.isFile(requestData)) &&
|
||||||
|
requestData.type
|
||||||
|
) {
|
||||||
|
delete requestHeaders['Content-Type']; // Let the browser set it
|
||||||
|
}
|
||||||
|
|
||||||
var request = new XMLHttpRequest();
|
var request = new XMLHttpRequest();
|
||||||
|
|
||||||
// HTTP basic authentication
|
// HTTP basic authentication
|
||||||
if (config.auth) {
|
if (config.auth) {
|
||||||
var username = config.auth.username || '';
|
var username = config.auth.username || '';
|
||||||
var password = config.auth.password || '';
|
var password = unescape(encodeURIComponent(config.auth.password)) || '';
|
||||||
requestHeaders.Authorization = 'Basic ' + btoa(username + ':' + password);
|
requestHeaders.Authorization = 'Basic ' + btoa(username + ':' + password);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1069,8 +1085,6 @@ return /******/ (function(modules) { // webpackBootstrap
|
|||||||
// This is only done if running in a standard browser environment.
|
// This is only done if running in a standard browser environment.
|
||||||
// Specifically not if we're in a web worker, or react-native.
|
// Specifically not if we're in a web worker, or react-native.
|
||||||
if (utils.isStandardBrowserEnv()) {
|
if (utils.isStandardBrowserEnv()) {
|
||||||
var cookies = __webpack_require__(21);
|
|
||||||
|
|
||||||
// Add xsrf header
|
// Add xsrf header
|
||||||
var xsrfValue = (config.withCredentials || isURLSameOrigin(fullPath)) && config.xsrfCookieName ?
|
var xsrfValue = (config.withCredentials || isURLSameOrigin(fullPath)) && config.xsrfCookieName ?
|
||||||
cookies.read(config.xsrfCookieName) :
|
cookies.read(config.xsrfCookieName) :
|
||||||
@@ -1136,7 +1150,7 @@ return /******/ (function(modules) { // webpackBootstrap
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
if (requestData === undefined) {
|
if (!requestData) {
|
||||||
requestData = null;
|
requestData = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1163,7 +1177,7 @@ return /******/ (function(modules) { // webpackBootstrap
|
|||||||
*/
|
*/
|
||||||
module.exports = function settle(resolve, reject, response) {
|
module.exports = function settle(resolve, reject, response) {
|
||||||
var validateStatus = response.config.validateStatus;
|
var validateStatus = response.config.validateStatus;
|
||||||
if (!validateStatus || validateStatus(response.status)) {
|
if (!response.status || !validateStatus || validateStatus(response.status)) {
|
||||||
resolve(response);
|
resolve(response);
|
||||||
} else {
|
} else {
|
||||||
reject(createError(
|
reject(createError(
|
||||||
@@ -1227,7 +1241,7 @@ return /******/ (function(modules) { // webpackBootstrap
|
|||||||
error.response = response;
|
error.response = response;
|
||||||
error.isAxiosError = true;
|
error.isAxiosError = true;
|
||||||
|
|
||||||
error.toJSON = function() {
|
error.toJSON = function toJSON() {
|
||||||
return {
|
return {
|
||||||
// Standard
|
// Standard
|
||||||
message: this.message,
|
message: this.message,
|
||||||
@@ -1255,8 +1269,67 @@ return /******/ (function(modules) { // webpackBootstrap
|
|||||||
|
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
var isAbsoluteURL = __webpack_require__(17);
|
var utils = __webpack_require__(2);
|
||||||
var combineURLs = __webpack_require__(18);
|
|
||||||
|
module.exports = (
|
||||||
|
utils.isStandardBrowserEnv() ?
|
||||||
|
|
||||||
|
// Standard browser envs support document.cookie
|
||||||
|
(function standardBrowserEnv() {
|
||||||
|
return {
|
||||||
|
write: function write(name, value, expires, path, domain, secure) {
|
||||||
|
var cookie = [];
|
||||||
|
cookie.push(name + '=' + encodeURIComponent(value));
|
||||||
|
|
||||||
|
if (utils.isNumber(expires)) {
|
||||||
|
cookie.push('expires=' + new Date(expires).toGMTString());
|
||||||
|
}
|
||||||
|
|
||||||
|
if (utils.isString(path)) {
|
||||||
|
cookie.push('path=' + path);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (utils.isString(domain)) {
|
||||||
|
cookie.push('domain=' + domain);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (secure === true) {
|
||||||
|
cookie.push('secure');
|
||||||
|
}
|
||||||
|
|
||||||
|
document.cookie = cookie.join('; ');
|
||||||
|
},
|
||||||
|
|
||||||
|
read: function read(name) {
|
||||||
|
var match = document.cookie.match(new RegExp('(^|;\\s*)(' + name + ')=([^;]*)'));
|
||||||
|
return (match ? decodeURIComponent(match[3]) : null);
|
||||||
|
},
|
||||||
|
|
||||||
|
remove: function remove(name) {
|
||||||
|
this.write(name, '', Date.now() - 86400000);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
})() :
|
||||||
|
|
||||||
|
// Non standard browser env (web workers, react-native) lack needed support.
|
||||||
|
(function nonStandardBrowserEnv() {
|
||||||
|
return {
|
||||||
|
write: function write() {},
|
||||||
|
read: function read() { return null; },
|
||||||
|
remove: function remove() {}
|
||||||
|
};
|
||||||
|
})()
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
/* 17 */
|
||||||
|
/***/ (function(module, exports, __webpack_require__) {
|
||||||
|
|
||||||
|
'use strict';
|
||||||
|
|
||||||
|
var isAbsoluteURL = __webpack_require__(18);
|
||||||
|
var combineURLs = __webpack_require__(19);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a new URL by combining the baseURL with the requestedURL,
|
* Creates a new URL by combining the baseURL with the requestedURL,
|
||||||
@@ -1276,7 +1349,7 @@ return /******/ (function(modules) { // webpackBootstrap
|
|||||||
|
|
||||||
|
|
||||||
/***/ }),
|
/***/ }),
|
||||||
/* 17 */
|
/* 18 */
|
||||||
/***/ (function(module, exports) {
|
/***/ (function(module, exports) {
|
||||||
|
|
||||||
'use strict';
|
'use strict';
|
||||||
@@ -1296,7 +1369,7 @@ return /******/ (function(modules) { // webpackBootstrap
|
|||||||
|
|
||||||
|
|
||||||
/***/ }),
|
/***/ }),
|
||||||
/* 18 */
|
/* 19 */
|
||||||
/***/ (function(module, exports) {
|
/***/ (function(module, exports) {
|
||||||
|
|
||||||
'use strict';
|
'use strict';
|
||||||
@@ -1316,7 +1389,7 @@ return /******/ (function(modules) { // webpackBootstrap
|
|||||||
|
|
||||||
|
|
||||||
/***/ }),
|
/***/ }),
|
||||||
/* 19 */
|
/* 20 */
|
||||||
/***/ (function(module, exports, __webpack_require__) {
|
/***/ (function(module, exports, __webpack_require__) {
|
||||||
|
|
||||||
'use strict';
|
'use strict';
|
||||||
@@ -1375,7 +1448,7 @@ return /******/ (function(modules) { // webpackBootstrap
|
|||||||
|
|
||||||
|
|
||||||
/***/ }),
|
/***/ }),
|
||||||
/* 20 */
|
/* 21 */
|
||||||
/***/ (function(module, exports, __webpack_require__) {
|
/***/ (function(module, exports, __webpack_require__) {
|
||||||
|
|
||||||
'use strict';
|
'use strict';
|
||||||
@@ -1448,65 +1521,6 @@ return /******/ (function(modules) { // webpackBootstrap
|
|||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
/***/ }),
|
|
||||||
/* 21 */
|
|
||||||
/***/ (function(module, exports, __webpack_require__) {
|
|
||||||
|
|
||||||
'use strict';
|
|
||||||
|
|
||||||
var utils = __webpack_require__(2);
|
|
||||||
|
|
||||||
module.exports = (
|
|
||||||
utils.isStandardBrowserEnv() ?
|
|
||||||
|
|
||||||
// Standard browser envs support document.cookie
|
|
||||||
(function standardBrowserEnv() {
|
|
||||||
return {
|
|
||||||
write: function write(name, value, expires, path, domain, secure) {
|
|
||||||
var cookie = [];
|
|
||||||
cookie.push(name + '=' + encodeURIComponent(value));
|
|
||||||
|
|
||||||
if (utils.isNumber(expires)) {
|
|
||||||
cookie.push('expires=' + new Date(expires).toGMTString());
|
|
||||||
}
|
|
||||||
|
|
||||||
if (utils.isString(path)) {
|
|
||||||
cookie.push('path=' + path);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (utils.isString(domain)) {
|
|
||||||
cookie.push('domain=' + domain);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (secure === true) {
|
|
||||||
cookie.push('secure');
|
|
||||||
}
|
|
||||||
|
|
||||||
document.cookie = cookie.join('; ');
|
|
||||||
},
|
|
||||||
|
|
||||||
read: function read(name) {
|
|
||||||
var match = document.cookie.match(new RegExp('(^|;\\s*)(' + name + ')=([^;]*)'));
|
|
||||||
return (match ? decodeURIComponent(match[3]) : null);
|
|
||||||
},
|
|
||||||
|
|
||||||
remove: function remove(name) {
|
|
||||||
this.write(name, '', Date.now() - 86400000);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
})() :
|
|
||||||
|
|
||||||
// Non standard browser env (web workers, react-native) lack needed support.
|
|
||||||
(function nonStandardBrowserEnv() {
|
|
||||||
return {
|
|
||||||
write: function write() {},
|
|
||||||
read: function read() { return null; },
|
|
||||||
remove: function remove() {}
|
|
||||||
};
|
|
||||||
})()
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
/***/ }),
|
/***/ }),
|
||||||
/* 22 */
|
/* 22 */
|
||||||
/***/ (function(module, exports, __webpack_require__) {
|
/***/ (function(module, exports, __webpack_require__) {
|
||||||
@@ -1528,59 +1542,73 @@ return /******/ (function(modules) { // webpackBootstrap
|
|||||||
config2 = config2 || {};
|
config2 = config2 || {};
|
||||||
var config = {};
|
var config = {};
|
||||||
|
|
||||||
var valueFromConfig2Keys = ['url', 'method', 'params', 'data'];
|
var valueFromConfig2Keys = ['url', 'method', 'data'];
|
||||||
var mergeDeepPropertiesKeys = ['headers', 'auth', 'proxy'];
|
var mergeDeepPropertiesKeys = ['headers', 'auth', 'proxy', 'params'];
|
||||||
var defaultToConfig2Keys = [
|
var defaultToConfig2Keys = [
|
||||||
'baseURL', 'url', 'transformRequest', 'transformResponse', 'paramsSerializer',
|
'baseURL', 'transformRequest', 'transformResponse', 'paramsSerializer',
|
||||||
'timeout', 'withCredentials', 'adapter', 'responseType', 'xsrfCookieName',
|
'timeout', 'timeoutMessage', 'withCredentials', 'adapter', 'responseType', 'xsrfCookieName',
|
||||||
'xsrfHeaderName', 'onUploadProgress', 'onDownloadProgress',
|
'xsrfHeaderName', 'onUploadProgress', 'onDownloadProgress', 'decompress',
|
||||||
'maxContentLength', 'validateStatus', 'maxRedirects', 'httpAgent',
|
'maxContentLength', 'maxBodyLength', 'maxRedirects', 'transport', 'httpAgent',
|
||||||
'httpsAgent', 'cancelToken', 'socketPath'
|
'httpsAgent', 'cancelToken', 'socketPath', 'responseEncoding'
|
||||||
];
|
];
|
||||||
|
var directMergeKeys = ['validateStatus'];
|
||||||
|
|
||||||
|
function getMergedValue(target, source) {
|
||||||
|
if (utils.isPlainObject(target) && utils.isPlainObject(source)) {
|
||||||
|
return utils.merge(target, source);
|
||||||
|
} else if (utils.isPlainObject(source)) {
|
||||||
|
return utils.merge({}, source);
|
||||||
|
} else if (utils.isArray(source)) {
|
||||||
|
return source.slice();
|
||||||
|
}
|
||||||
|
return source;
|
||||||
|
}
|
||||||
|
|
||||||
|
function mergeDeepProperties(prop) {
|
||||||
|
if (!utils.isUndefined(config2[prop])) {
|
||||||
|
config[prop] = getMergedValue(config1[prop], config2[prop]);
|
||||||
|
} else if (!utils.isUndefined(config1[prop])) {
|
||||||
|
config[prop] = getMergedValue(undefined, config1[prop]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
utils.forEach(valueFromConfig2Keys, function valueFromConfig2(prop) {
|
utils.forEach(valueFromConfig2Keys, function valueFromConfig2(prop) {
|
||||||
if (typeof config2[prop] !== 'undefined') {
|
if (!utils.isUndefined(config2[prop])) {
|
||||||
config[prop] = config2[prop];
|
config[prop] = getMergedValue(undefined, config2[prop]);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
utils.forEach(mergeDeepPropertiesKeys, function mergeDeepProperties(prop) {
|
utils.forEach(mergeDeepPropertiesKeys, mergeDeepProperties);
|
||||||
if (utils.isObject(config2[prop])) {
|
|
||||||
config[prop] = utils.deepMerge(config1[prop], config2[prop]);
|
|
||||||
} else if (typeof config2[prop] !== 'undefined') {
|
|
||||||
config[prop] = config2[prop];
|
|
||||||
} else if (utils.isObject(config1[prop])) {
|
|
||||||
config[prop] = utils.deepMerge(config1[prop]);
|
|
||||||
} else if (typeof config1[prop] !== 'undefined') {
|
|
||||||
config[prop] = config1[prop];
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
utils.forEach(defaultToConfig2Keys, function defaultToConfig2(prop) {
|
utils.forEach(defaultToConfig2Keys, function defaultToConfig2(prop) {
|
||||||
if (typeof config2[prop] !== 'undefined') {
|
if (!utils.isUndefined(config2[prop])) {
|
||||||
config[prop] = config2[prop];
|
config[prop] = getMergedValue(undefined, config2[prop]);
|
||||||
} else if (typeof config1[prop] !== 'undefined') {
|
} else if (!utils.isUndefined(config1[prop])) {
|
||||||
config[prop] = config1[prop];
|
config[prop] = getMergedValue(undefined, config1[prop]);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
utils.forEach(directMergeKeys, function merge(prop) {
|
||||||
|
if (prop in config2) {
|
||||||
|
config[prop] = getMergedValue(config1[prop], config2[prop]);
|
||||||
|
} else if (prop in config1) {
|
||||||
|
config[prop] = getMergedValue(undefined, config1[prop]);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
var axiosKeys = valueFromConfig2Keys
|
var axiosKeys = valueFromConfig2Keys
|
||||||
.concat(mergeDeepPropertiesKeys)
|
.concat(mergeDeepPropertiesKeys)
|
||||||
.concat(defaultToConfig2Keys);
|
.concat(defaultToConfig2Keys)
|
||||||
|
.concat(directMergeKeys);
|
||||||
|
|
||||||
var otherKeys = Object
|
var otherKeys = Object
|
||||||
.keys(config2)
|
.keys(config1)
|
||||||
|
.concat(Object.keys(config2))
|
||||||
.filter(function filterAxiosKeys(key) {
|
.filter(function filterAxiosKeys(key) {
|
||||||
return axiosKeys.indexOf(key) === -1;
|
return axiosKeys.indexOf(key) === -1;
|
||||||
});
|
});
|
||||||
|
|
||||||
utils.forEach(otherKeys, function otherKeysDefaultToConfig2(prop) {
|
utils.forEach(otherKeys, mergeDeepProperties);
|
||||||
if (typeof config2[prop] !== 'undefined') {
|
|
||||||
config[prop] = config2[prop];
|
|
||||||
} else if (typeof config1[prop] !== 'undefined') {
|
|
||||||
config[prop] = config1[prop];
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
return config;
|
return config;
|
||||||
};
|
};
|
||||||
|
|||||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+2
-1
File diff suppressed because one or more lines are too long
Vendored
+1
-1
File diff suppressed because one or more lines are too long
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "axios",
|
"name": "axios",
|
||||||
"version": "0.19.2",
|
"version": "0.20.0-0",
|
||||||
"description": "Promise based HTTP client for the browser and node.js",
|
"description": "Promise based HTTP client for the browser and node.js",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
Reference in New Issue
Block a user