2
0
mirror of https://github.com/tenrok/axios.git synced 2026-06-23 20:40:40 +03:00

chore(release): v1.4.0 (#5683)

Co-authored-by: DigitalBrainJS <DigitalBrainJS@users.noreply.github.com>
This commit is contained in:
github-actions[bot]
2023-04-28 02:04:53 +03:00
committed by GitHub
parent d627610d0c
commit 21a5ad34c4
17 changed files with 136 additions and 40 deletions
+16 -6
View File
@@ -1,4 +1,4 @@
// Axios v1.3.6 Copyright (c) 2023 Matt Zabriskie and contributors
// Axios v1.4.0 Copyright (c) 2023 Matt Zabriskie and contributors
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
typeof define === 'function' && define.amd ? define(factory) :
@@ -722,6 +722,10 @@
};
return visit(obj, 0);
};
var isAsyncFn = kindOfTest('AsyncFunction');
var isThenable = function isThenable(thing) {
return thing && (isObject(thing) || isFunction(thing)) && isFunction(thing.then) && isFunction(thing["catch"]);
};
var utils = {
isArray: isArray,
isArrayBuffer: isArrayBuffer,
@@ -772,7 +776,9 @@
ALPHABET: ALPHABET,
generateString: generateString,
isSpecCompliantForm: isSpecCompliantForm,
toJSONObject: toJSONObject
toJSONObject: toJSONObject,
isAsyncFn: isAsyncFn,
isThenable: isThenable
};
/**
@@ -2061,8 +2067,12 @@
config.signal.removeEventListener('abort', onCanceled);
}
}
if (utils.isFormData(requestData) && (platform.isStandardBrowserEnv || platform.isStandardBrowserWebWorkerEnv)) {
requestHeaders.setContentType(false); // Let the browser set it
if (utils.isFormData(requestData)) {
if (platform.isStandardBrowserEnv || platform.isStandardBrowserWebWorkerEnv) {
requestHeaders.setContentType(false); // Let the browser set it
} else {
requestHeaders.setContentType('multipart/form-data;', false); // mobile/desktop app frameworks
}
}
var request = new XMLHttpRequest();
@@ -2422,7 +2432,7 @@
return mergeDeepProperties(headersToObject(a), headersToObject(b), true);
}
};
utils.forEach(Object.keys(config1).concat(Object.keys(config2)), function computeConfigValue(prop) {
utils.forEach(Object.keys(Object.assign({}, config1, config2)), function computeConfigValue(prop) {
var merge = mergeMap[prop] || mergeDeepProperties;
var configValue = merge(config1[prop], config2[prop], prop);
utils.isUndefined(configValue) && merge !== mergeDirectKeys || (config[prop] = configValue);
@@ -2430,7 +2440,7 @@
return config;
}
var VERSION = "1.3.6";
var VERSION = "1.4.0";
var validators$1 = {};
+1 -1
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
File diff suppressed because one or more lines are too long
+17 -6
View File
@@ -1,4 +1,4 @@
// Axios v1.3.6 Copyright (c) 2023 Matt Zabriskie and contributors
// Axios v1.4.0 Copyright (c) 2023 Matt Zabriskie and contributors
'use strict';
function bind(fn, thisArg) {
@@ -667,6 +667,11 @@ const toJSONObject = (obj) => {
return visit(obj, 0);
};
const isAsyncFn = kindOfTest('AsyncFunction');
const isThenable = (thing) =>
thing && (isObject(thing) || isFunction(thing)) && isFunction(thing.then) && isFunction(thing.catch);
var utils = {
isArray,
isArrayBuffer,
@@ -716,7 +721,9 @@ var utils = {
ALPHABET,
generateString,
isSpecCompliantForm,
toJSONObject
toJSONObject,
isAsyncFn,
isThenable
};
/**
@@ -2204,8 +2211,12 @@ var xhrAdapter = isXHRAdapterSupported && function (config) {
}
}
if (utils.isFormData(requestData) && (platform.isStandardBrowserEnv || platform.isStandardBrowserWebWorkerEnv)) {
requestHeaders.setContentType(false); // Let the browser set it
if (utils.isFormData(requestData)) {
if (platform.isStandardBrowserEnv || platform.isStandardBrowserWebWorkerEnv) {
requestHeaders.setContentType(false); // Let the browser set it
} else {
requestHeaders.setContentType('multipart/form-data;', false); // mobile/desktop app frameworks
}
}
let request = new XMLHttpRequest();
@@ -2611,7 +2622,7 @@ function mergeConfig(config1, config2) {
headers: (a, b) => mergeDeepProperties(headersToObject(a), headersToObject(b), true)
};
utils.forEach(Object.keys(config1).concat(Object.keys(config2)), function computeConfigValue(prop) {
utils.forEach(Object.keys(Object.assign({}, config1, config2)), function computeConfigValue(prop) {
const merge = mergeMap[prop] || mergeDeepProperties;
const configValue = merge(config1[prop], config2[prop], prop);
(utils.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue);
@@ -2620,7 +2631,7 @@ function mergeConfig(config1, config2) {
return config;
}
const VERSION = "1.3.6";
const VERSION = "1.4.0";
const validators$1 = {};
+1 -1
View File
File diff suppressed because one or more lines are too long
+17 -6
View File
@@ -1,4 +1,4 @@
// Axios v1.3.6 Copyright (c) 2023 Matt Zabriskie and contributors
// Axios v1.4.0 Copyright (c) 2023 Matt Zabriskie and contributors
function bind(fn, thisArg) {
return function wrap() {
return fn.apply(thisArg, arguments);
@@ -665,6 +665,11 @@ const toJSONObject = (obj) => {
return visit(obj, 0);
};
const isAsyncFn = kindOfTest('AsyncFunction');
const isThenable = (thing) =>
thing && (isObject(thing) || isFunction(thing)) && isFunction(thing.then) && isFunction(thing.catch);
const utils = {
isArray,
isArrayBuffer,
@@ -714,7 +719,9 @@ const utils = {
ALPHABET,
generateString,
isSpecCompliantForm,
toJSONObject
toJSONObject,
isAsyncFn,
isThenable
};
/**
@@ -2202,8 +2209,12 @@ const xhrAdapter = isXHRAdapterSupported && function (config) {
}
}
if (utils.isFormData(requestData) && (platform.isStandardBrowserEnv || platform.isStandardBrowserWebWorkerEnv)) {
requestHeaders.setContentType(false); // Let the browser set it
if (utils.isFormData(requestData)) {
if (platform.isStandardBrowserEnv || platform.isStandardBrowserWebWorkerEnv) {
requestHeaders.setContentType(false); // Let the browser set it
} else {
requestHeaders.setContentType('multipart/form-data;', false); // mobile/desktop app frameworks
}
}
let request = new XMLHttpRequest();
@@ -2609,7 +2620,7 @@ function mergeConfig$1(config1, config2) {
headers: (a, b) => mergeDeepProperties(headersToObject(a), headersToObject(b), true)
};
utils.forEach(Object.keys(config1).concat(Object.keys(config2)), function computeConfigValue(prop) {
utils.forEach(Object.keys(Object.assign({}, config1, config2)), function computeConfigValue(prop) {
const merge = mergeMap[prop] || mergeDeepProperties;
const configValue = merge(config1[prop], config2[prop], prop);
(utils.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue);
@@ -2618,7 +2629,7 @@ function mergeConfig$1(config1, config2) {
return config;
}
const VERSION$1 = "1.3.6";
const VERSION$1 = "1.4.0";
const validators$1 = {};
+1 -1
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
File diff suppressed because one or more lines are too long
+46 -7
View File
@@ -1,4 +1,4 @@
// Axios v1.3.6 Copyright (c) 2023 Matt Zabriskie and contributors
// Axios v1.4.0 Copyright (c) 2023 Matt Zabriskie and contributors
'use strict';
const FormData$1 = require('form-data');
@@ -690,6 +690,11 @@ const toJSONObject = (obj) => {
return visit(obj, 0);
};
const isAsyncFn = kindOfTest('AsyncFunction');
const isThenable = (thing) =>
thing && (isObject(thing) || isFunction(thing)) && isFunction(thing.then) && isFunction(thing.catch);
const utils = {
isArray,
isArrayBuffer,
@@ -739,7 +744,9 @@ const utils = {
ALPHABET,
generateString,
isSpecCompliantForm,
toJSONObject
toJSONObject,
isAsyncFn,
isThenable
};
/**
@@ -1954,7 +1961,7 @@ function buildFullPath(baseURL, requestedURL) {
return requestedURL;
}
const VERSION = "1.3.6";
const VERSION = "1.4.0";
function parseProtocol(url) {
const match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url);
@@ -2424,6 +2431,21 @@ class ZlibHeaderTransformStream extends stream__default["default"].Transform {
const ZlibHeaderTransformStream$1 = ZlibHeaderTransformStream;
const callbackify = (fn, reducer) => {
return utils.isAsyncFn(fn) ? function (...args) {
const cb = args.pop();
fn.apply(this, args).then((value) => {
try {
reducer ? cb(null, ...reducer(value)) : cb(null, value);
} catch (err) {
cb(err);
}
}, cb);
} : fn;
};
const callbackify$1 = callbackify;
const zlibOptions = {
flush: zlib__default["default"].constants.Z_SYNC_FLUSH,
finishFlush: zlib__default["default"].constants.Z_SYNC_FLUSH
@@ -2546,13 +2568,24 @@ const wrapAsync = (asyncExecutor) => {
/*eslint consistent-return:0*/
const httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
return wrapAsync(async function dispatchHttpRequest(resolve, reject, onDone) {
let {data} = config;
let {data, lookup, family} = config;
const {responseType, responseEncoding} = config;
const method = config.method.toUpperCase();
let isDone;
let rejected = false;
let req;
if (lookup && utils.isAsyncFn(lookup)) {
lookup = callbackify$1(lookup, (entry) => {
if(utils.isString(entry)) {
entry = [entry, entry.indexOf('.') < 0 ? 6 : 4];
} else if (!utils.isArray(entry)) {
throw new TypeError('lookup async function must return an array [ip: string, family: number]]')
}
return entry;
});
}
// temporary internal emitter until the AxiosRequest class will be implemented
const emitter = new EventEmitter__default["default"]();
@@ -2776,6 +2809,8 @@ const httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
agents: { http: config.httpAgent, https: config.httpsAgent },
auth,
protocol,
family,
lookup,
beforeRedirect: dispatchBeforeRedirect,
beforeRedirects: {}
};
@@ -3205,8 +3240,12 @@ const xhrAdapter = isXHRAdapterSupported && function (config) {
}
}
if (utils.isFormData(requestData) && (platform.isStandardBrowserEnv || platform.isStandardBrowserWebWorkerEnv)) {
requestHeaders.setContentType(false); // Let the browser set it
if (utils.isFormData(requestData)) {
if (platform.isStandardBrowserEnv || platform.isStandardBrowserWebWorkerEnv) {
requestHeaders.setContentType(false); // Let the browser set it
} else {
requestHeaders.setContentType('multipart/form-data;', false); // mobile/desktop app frameworks
}
}
let request = new XMLHttpRequest();
@@ -3612,7 +3651,7 @@ function mergeConfig(config1, config2) {
headers: (a, b) => mergeDeepProperties(headersToObject(a), headersToObject(b), true)
};
utils.forEach(Object.keys(config1).concat(Object.keys(config2)), function computeConfigValue(prop) {
utils.forEach(Object.keys(Object.assign({}, config1, config2)), function computeConfigValue(prop) {
const merge = mergeMap[prop] || mergeDeepProperties;
const configValue = merge(config1[prop], config2[prop], prop);
(utils.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue);
+1 -1
View File
File diff suppressed because one or more lines are too long