2
0
mirror of https://github.com/tenrok/axios.git synced 2026-06-17 19:21:29 +03:00

chore(release): v1.11.0 (#6974)

Co-authored-by: jasonsaayman <4814473+jasonsaayman@users.noreply.github.com>
This commit is contained in:
github-actions[bot]
2025-07-23 08:04:30 +02:00
committed by GitHub
parent e72c193722
commit b76c4ac6f8
17 changed files with 212 additions and 50 deletions
+39 -5
View File
@@ -1,4 +1,4 @@
/*! Axios v1.10.0 Copyright (c) 2025 Matt Zabriskie and contributors */
/*! Axios v1.11.0 Copyright (c) 2025 Matt Zabriskie and contributors */
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
typeof define === 'function' && define.amd ? define(factory) :
@@ -818,6 +818,26 @@
return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(toStringTag in val) && !(iterator in val);
};
/**
* Determine if a value is an empty object (safely handles Buffers)
*
* @param {*} val The value to test
*
* @returns {boolean} True if value is an empty object, otherwise false
*/
var isEmptyObject = function isEmptyObject(val) {
// Early return for non-objects or Buffers to prevent RangeError
if (!isObject(val) || isBuffer(val)) {
return false;
}
try {
return Object.keys(val).length === 0 && Object.getPrototypeOf(val) === Object.prototype;
} catch (e) {
// Fallback for any other objects that might cause RangeError with Object.keys()
return false;
}
};
/**
* Determine if a value is a Date
*
@@ -942,6 +962,11 @@
fn.call(null, obj[i], i, obj);
}
} else {
// Buffer check
if (isBuffer(obj)) {
return;
}
// Iterate over object keys
var keys = allOwnKeys ? Object.getOwnPropertyNames(obj) : Object.keys(obj);
var len = keys.length;
@@ -953,6 +978,9 @@
}
}
function findKey(obj, key) {
if (isBuffer(obj)) {
return null;
}
key = key.toLowerCase();
var keys = Object.keys(obj);
var i = keys.length;
@@ -1286,6 +1314,11 @@
if (stack.indexOf(source) >= 0) {
return;
}
//Buffer check
if (isBuffer(source)) {
return source;
}
if (!('toJSON' in source)) {
stack[i] = source;
var target = isArray(source) ? [] : {};
@@ -1347,6 +1380,7 @@
isBoolean: isBoolean,
isObject: isObject,
isPlainObject: isPlainObject,
isEmptyObject: isEmptyObject,
isReadableStream: isReadableStream,
isRequest: isRequest,
isResponse: isResponse,
@@ -1907,7 +1941,7 @@
var platform = _objectSpread2(_objectSpread2({}, utils), platform$1);
function toURLEncodedForm(data, options) {
return toFormData(data, new platform.classes.URLSearchParams(), Object.assign({
return toFormData(data, new platform.classes.URLSearchParams(), _objectSpread2({
visitor: function visitor(value, key, path, helpers) {
if (platform.isNode && utils$1.isBuffer(value)) {
this.append(key, value.toString('base64'));
@@ -2576,7 +2610,7 @@
clearTimeout(timer);
timer = null;
}
fn.apply(null, args);
fn.apply(void 0, _toConsumableArray(args));
};
var throttled = function throttled() {
var now = Date.now();
@@ -2824,7 +2858,7 @@
return mergeDeepProperties(headersToObject(a), headersToObject(b), prop, true);
}
};
utils$1.forEach(Object.keys(Object.assign({}, config1, config2)), function computeConfigValue(prop) {
utils$1.forEach(Object.keys(_objectSpread2(_objectSpread2({}, config1), config2)), function computeConfigValue(prop) {
var merge = mergeMap[prop] || mergeDeepProperties;
var configValue = merge(config1[prop], config2[prop], prop);
utils$1.isUndefined(configValue) && merge !== mergeDirectKeys || (config[prop] = configValue);
@@ -3677,7 +3711,7 @@
});
}
var VERSION = "1.10.0";
var VERSION = "1.11.0";
var validators$1 = {};
+1 -1
View File
File diff suppressed because one or more lines are too long
+2 -2
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 -9
View File
@@ -1,4 +1,4 @@
/*! Axios v1.10.0 Copyright (c) 2025 Matt Zabriskie and contributors */
/*! Axios v1.11.0 Copyright (c) 2025 Matt Zabriskie and contributors */
'use strict';
function bind(fn, thisArg) {
@@ -141,6 +141,27 @@ const isPlainObject = (val) => {
return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(toStringTag in val) && !(iterator in val);
};
/**
* Determine if a value is an empty object (safely handles Buffers)
*
* @param {*} val The value to test
*
* @returns {boolean} True if value is an empty object, otherwise false
*/
const isEmptyObject = (val) => {
// Early return for non-objects or Buffers to prevent RangeError
if (!isObject(val) || isBuffer(val)) {
return false;
}
try {
return Object.keys(val).length === 0 && Object.getPrototypeOf(val) === Object.prototype;
} catch (e) {
// Fallback for any other objects that might cause RangeError with Object.keys()
return false;
}
};
/**
* Determine if a value is a Date
*
@@ -263,6 +284,11 @@ function forEach(obj, fn, {allOwnKeys = false} = {}) {
fn.call(null, obj[i], i, obj);
}
} else {
// Buffer check
if (isBuffer(obj)) {
return;
}
// Iterate over object keys
const keys = allOwnKeys ? Object.getOwnPropertyNames(obj) : Object.keys(obj);
const len = keys.length;
@@ -276,6 +302,10 @@ function forEach(obj, fn, {allOwnKeys = false} = {}) {
}
function findKey(obj, key) {
if (isBuffer(obj)){
return null;
}
key = key.toLowerCase();
const keys = Object.keys(obj);
let i = keys.length;
@@ -629,6 +659,11 @@ const toJSONObject = (obj) => {
return;
}
//Buffer check
if (isBuffer(source)) {
return source;
}
if(!('toJSON' in source)) {
stack[i] = source;
const target = isArray(source) ? [] : {};
@@ -700,6 +735,7 @@ var utils$1 = {
isBoolean,
isObject,
isPlainObject,
isEmptyObject,
isReadableStream,
isRequest,
isResponse,
@@ -1331,7 +1367,7 @@ var platform = {
};
function toURLEncodedForm(data, options) {
return toFormData(data, new platform.classes.URLSearchParams(), Object.assign({
return toFormData(data, new platform.classes.URLSearchParams(), {
visitor: function(value, key, path, helpers) {
if (platform.isNode && utils$1.isBuffer(value)) {
this.append(key, value.toString('base64'));
@@ -1339,8 +1375,9 @@ function toURLEncodedForm(data, options) {
}
return helpers.defaultVisitor.apply(this, arguments);
}
}, options));
},
...options
});
}
/**
@@ -2093,7 +2130,7 @@ function throttle(fn, freq) {
clearTimeout(timer);
timer = null;
}
fn.apply(null, args);
fn(...args);
};
const throttled = (...args) => {
@@ -2349,7 +2386,7 @@ function mergeConfig(config1, config2) {
headers: (a, b , prop) => mergeDeepProperties(headersToObject(a), headersToObject(b),prop, true)
};
utils$1.forEach(Object.keys(Object.assign({}, config1, config2)), function computeConfigValue(prop) {
utils$1.forEach(Object.keys({...config1, ...config2}), function computeConfigValue(prop) {
const merge = mergeMap[prop] || mergeDeepProperties;
const configValue = merge(config1[prop], config2[prop], prop);
(utils$1.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue);
@@ -3090,7 +3127,7 @@ function dispatchRequest(config) {
});
}
const VERSION = "1.10.0";
const VERSION = "1.11.0";
const validators$1 = {};
@@ -3329,8 +3366,8 @@ class Axios {
if (!synchronousRequestInterceptors) {
const chain = [dispatchRequest.bind(this), undefined];
chain.unshift.apply(chain, requestInterceptorChain);
chain.push.apply(chain, responseInterceptorChain);
chain.unshift(...requestInterceptorChain);
chain.push(...responseInterceptorChain);
len = chain.length;
promise = Promise.resolve(config);
+1 -1
View File
File diff suppressed because one or more lines are too long
+46 -9
View File
@@ -1,4 +1,4 @@
/*! Axios v1.10.0 Copyright (c) 2025 Matt Zabriskie and contributors */
/*! Axios v1.11.0 Copyright (c) 2025 Matt Zabriskie and contributors */
function bind(fn, thisArg) {
return function wrap() {
return fn.apply(thisArg, arguments);
@@ -139,6 +139,27 @@ const isPlainObject = (val) => {
return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(toStringTag in val) && !(iterator in val);
};
/**
* Determine if a value is an empty object (safely handles Buffers)
*
* @param {*} val The value to test
*
* @returns {boolean} True if value is an empty object, otherwise false
*/
const isEmptyObject = (val) => {
// Early return for non-objects or Buffers to prevent RangeError
if (!isObject(val) || isBuffer(val)) {
return false;
}
try {
return Object.keys(val).length === 0 && Object.getPrototypeOf(val) === Object.prototype;
} catch (e) {
// Fallback for any other objects that might cause RangeError with Object.keys()
return false;
}
};
/**
* Determine if a value is a Date
*
@@ -261,6 +282,11 @@ function forEach(obj, fn, {allOwnKeys = false} = {}) {
fn.call(null, obj[i], i, obj);
}
} else {
// Buffer check
if (isBuffer(obj)) {
return;
}
// Iterate over object keys
const keys = allOwnKeys ? Object.getOwnPropertyNames(obj) : Object.keys(obj);
const len = keys.length;
@@ -274,6 +300,10 @@ function forEach(obj, fn, {allOwnKeys = false} = {}) {
}
function findKey(obj, key) {
if (isBuffer(obj)){
return null;
}
key = key.toLowerCase();
const keys = Object.keys(obj);
let i = keys.length;
@@ -627,6 +657,11 @@ const toJSONObject = (obj) => {
return;
}
//Buffer check
if (isBuffer(source)) {
return source;
}
if(!('toJSON' in source)) {
stack[i] = source;
const target = isArray(source) ? [] : {};
@@ -698,6 +733,7 @@ const utils$1 = {
isBoolean,
isObject,
isPlainObject,
isEmptyObject,
isReadableStream,
isRequest,
isResponse,
@@ -1329,7 +1365,7 @@ const platform = {
};
function toURLEncodedForm(data, options) {
return toFormData$1(data, new platform.classes.URLSearchParams(), Object.assign({
return toFormData$1(data, new platform.classes.URLSearchParams(), {
visitor: function(value, key, path, helpers) {
if (platform.isNode && utils$1.isBuffer(value)) {
this.append(key, value.toString('base64'));
@@ -1337,8 +1373,9 @@ function toURLEncodedForm(data, options) {
}
return helpers.defaultVisitor.apply(this, arguments);
}
}, options));
},
...options
});
}
/**
@@ -2091,7 +2128,7 @@ function throttle(fn, freq) {
clearTimeout(timer);
timer = null;
}
fn.apply(null, args);
fn(...args);
};
const throttled = (...args) => {
@@ -2347,7 +2384,7 @@ function mergeConfig$1(config1, config2) {
headers: (a, b , prop) => mergeDeepProperties(headersToObject(a), headersToObject(b),prop, true)
};
utils$1.forEach(Object.keys(Object.assign({}, config1, config2)), function computeConfigValue(prop) {
utils$1.forEach(Object.keys({...config1, ...config2}), function computeConfigValue(prop) {
const merge = mergeMap[prop] || mergeDeepProperties;
const configValue = merge(config1[prop], config2[prop], prop);
(utils$1.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue);
@@ -3088,7 +3125,7 @@ function dispatchRequest(config) {
});
}
const VERSION$1 = "1.10.0";
const VERSION$1 = "1.11.0";
const validators$1 = {};
@@ -3327,8 +3364,8 @@ class Axios$1 {
if (!synchronousRequestInterceptors) {
const chain = [dispatchRequest.bind(this), undefined];
chain.unshift.apply(chain, requestInterceptorChain);
chain.push.apply(chain, responseInterceptorChain);
chain.unshift(...requestInterceptorChain);
chain.push(...responseInterceptorChain);
len = chain.length;
promise = Promise.resolve(config);
+1 -1
View File
File diff suppressed because one or more lines are too long
+2 -2
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 -9
View File
@@ -1,4 +1,4 @@
/*! Axios v1.10.0 Copyright (c) 2025 Matt Zabriskie and contributors */
/*! Axios v1.11.0 Copyright (c) 2025 Matt Zabriskie and contributors */
'use strict';
const FormData$1 = require('form-data');
@@ -166,6 +166,27 @@ const isPlainObject = (val) => {
return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(toStringTag in val) && !(iterator in val);
};
/**
* Determine if a value is an empty object (safely handles Buffers)
*
* @param {*} val The value to test
*
* @returns {boolean} True if value is an empty object, otherwise false
*/
const isEmptyObject = (val) => {
// Early return for non-objects or Buffers to prevent RangeError
if (!isObject(val) || isBuffer(val)) {
return false;
}
try {
return Object.keys(val).length === 0 && Object.getPrototypeOf(val) === Object.prototype;
} catch (e) {
// Fallback for any other objects that might cause RangeError with Object.keys()
return false;
}
};
/**
* Determine if a value is a Date
*
@@ -288,6 +309,11 @@ function forEach(obj, fn, {allOwnKeys = false} = {}) {
fn.call(null, obj[i], i, obj);
}
} else {
// Buffer check
if (isBuffer(obj)) {
return;
}
// Iterate over object keys
const keys = allOwnKeys ? Object.getOwnPropertyNames(obj) : Object.keys(obj);
const len = keys.length;
@@ -301,6 +327,10 @@ function forEach(obj, fn, {allOwnKeys = false} = {}) {
}
function findKey(obj, key) {
if (isBuffer(obj)){
return null;
}
key = key.toLowerCase();
const keys = Object.keys(obj);
let i = keys.length;
@@ -654,6 +684,11 @@ const toJSONObject = (obj) => {
return;
}
//Buffer check
if (isBuffer(source)) {
return source;
}
if(!('toJSON' in source)) {
stack[i] = source;
const target = isArray(source) ? [] : {};
@@ -725,6 +760,7 @@ const utils$1 = {
isBoolean,
isObject,
isPlainObject,
isEmptyObject,
isReadableStream,
isRequest,
isResponse,
@@ -1374,7 +1410,7 @@ const platform = {
};
function toURLEncodedForm(data, options) {
return toFormData(data, new platform.classes.URLSearchParams(), Object.assign({
return toFormData(data, new platform.classes.URLSearchParams(), {
visitor: function(value, key, path, helpers) {
if (platform.isNode && utils$1.isBuffer(value)) {
this.append(key, value.toString('base64'));
@@ -1382,8 +1418,9 @@ function toURLEncodedForm(data, options) {
}
return helpers.defaultVisitor.apply(this, arguments);
}
}, options));
},
...options
});
}
/**
@@ -2106,7 +2143,7 @@ function buildFullPath(baseURL, requestedURL, allowAbsoluteUrls) {
return requestedURL;
}
const VERSION = "1.10.0";
const VERSION = "1.11.0";
function parseProtocol(url) {
const match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url);
@@ -2534,7 +2571,7 @@ function throttle(fn, freq) {
clearTimeout(timer);
timer = null;
}
fn.apply(null, args);
fn(...args);
};
const throttled = (...args) => {
@@ -3408,7 +3445,7 @@ function mergeConfig(config1, config2) {
headers: (a, b , prop) => mergeDeepProperties(headersToObject(a), headersToObject(b),prop, true)
};
utils$1.forEach(Object.keys(Object.assign({}, config1, config2)), function computeConfigValue(prop) {
utils$1.forEach(Object.keys({...config1, ...config2}), function computeConfigValue(prop) {
const merge = mergeMap[prop] || mergeDeepProperties;
const configValue = merge(config1[prop], config2[prop], prop);
(utils$1.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue);
@@ -4386,8 +4423,8 @@ class Axios {
if (!synchronousRequestInterceptors) {
const chain = [dispatchRequest.bind(this), undefined];
chain.unshift.apply(chain, requestInterceptorChain);
chain.push.apply(chain, responseInterceptorChain);
chain.unshift(...requestInterceptorChain);
chain.push(...responseInterceptorChain);
len = chain.length;
promise = Promise.resolve(config);
+1 -1
View File
File diff suppressed because one or more lines are too long