nuxt4, and some changes on packages

This commit is contained in:
2025-08-19 21:38:30 +03:30
parent 61fee6c3da
commit 5b6f1a1cdf
900 changed files with 11139 additions and 15161 deletions
+1 -1
View File
@@ -167,7 +167,7 @@ export default isFetchSupported && (async (config) => {
credentials: isCredentialsSupported ? withCredentials : undefined
});
let response = await fetch(request);
let response = await fetch(request, fetchOptions);
const isStreamResponse = supportsResponseStream && (responseType === 'stream' || responseType === 'response');
+2 -2
View File
@@ -153,8 +153,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
@@ -96,7 +96,7 @@ export default function mergeConfig(config1, config2) {
headers: (a, b , prop) => mergeDeepProperties(headersToObject(a), headersToObject(b),prop, true)
};
utils.forEach(Object.keys(Object.assign({}, config1, config2)), function computeConfigValue(prop) {
utils.forEach(Object.keys({...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
@@ -1 +1 @@
export const VERSION = "1.9.0";
export const VERSION = "1.11.0";
+1 -1
View File
@@ -17,7 +17,7 @@ function throttle(fn, freq) {
clearTimeout(timer);
timer = null;
}
fn.apply(null, args);
fn(...args);
}
const throttled = (...args) => {
+4
View File
@@ -120,6 +120,10 @@ function toFormData(obj, formData, options) {
return value.toISOString();
}
if (utils.isBoolean(value)) {
return value.toString();
}
if (!useBlob && utils.isBlob(value)) {
throw new AxiosError('Blob is not supported. Use a Buffer instead.');
}
+4 -3
View File
@@ -5,7 +5,7 @@ import toFormData from './toFormData.js';
import platform from '../platform/index.js';
export default 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.isBuffer(value)) {
this.append(key, value.toString('base64'));
@@ -13,6 +13,7 @@ export default function toURLEncodedForm(data, options) {
}
return helpers.defaultVisitor.apply(this, arguments);
}
}, options));
},
...options
});
}
+36
View File
@@ -136,6 +136,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
*
@@ -258,6 +279,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;
@@ -271,6 +297,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;
@@ -624,6 +654,11 @@ const toJSONObject = (obj) => {
return;
}
//Buffer check
if (isBuffer(source)) {
return source;
}
if(!('toJSON' in source)) {
stack[i] = source;
const target = isArray(source) ? [] : {};
@@ -695,6 +730,7 @@ export default {
isBoolean,
isObject,
isPlainObject,
isEmptyObject,
isReadableStream,
isRequest,
isResponse,
+14 -5
View File
@@ -1,6 +1,6 @@
{
"name": "axios",
"version": "1.9.0",
"version": "1.11.0",
"description": "Promise based HTTP client for the browser and node.js",
"main": "index.js",
"exports": {
@@ -9,6 +9,10 @@
"require": "./index.d.cts",
"default": "./index.d.ts"
},
"react-native": {
"require": "./dist/browser/axios.cjs",
"default": "./dist/esm/axios.js"
},
"browser": {
"require": "./dist/browser/axios.cjs",
"default": "./index.js"
@@ -143,12 +147,17 @@
"./lib/platform/node/index.js": "./lib/platform/browser/index.js",
"./lib/platform/node/classes/FormData.js": "./lib/helpers/null.js"
},
"react-native": {
"./lib/adapters/http.js": "./lib/helpers/null.js",
"./lib/platform/node/index.js": "./lib/platform/browser/index.js",
"./lib/platform/node/classes/FormData.js": "./lib/helpers/null.js"
},
"jsdelivr": "dist/axios.min.js",
"unpkg": "dist/axios.min.js",
"typings": "./index.d.ts",
"dependencies": {
"follow-redirects": "^1.15.6",
"form-data": "^4.0.0",
"form-data": "^4.0.4",
"proxy-from-env": "^1.1.0"
},
"bundlesize": [
@@ -167,10 +176,10 @@
"Justin Beckwith (https://github.com/JustinBeckwith)",
"Martti Laine (https://github.com/codeclown)",
"Xianming Zhong (https://github.com/chinesedfan)",
"Rikki Gibson (https://github.com/RikkiGibson)",
"Remco Haszing (https://github.com/remcohaszing)",
"Yasu Flores (https://github.com/yasuf)",
"Ben Carp (https://github.com/carpben)"
"Rikki Gibson (https://github.com/RikkiGibson)",
"Ben Carp (https://github.com/carpben)",
"Yasu Flores (https://github.com/yasuf)"
],
"sideEffects": false,
"release-it": {