mirror of
https://github.com/tenrok/axios.git
synced 2026-06-17 19:21:29 +03:00
chore(release): v1.7.7 (#6585)
Co-authored-by: DigitalBrainJS <12586868+DigitalBrainJS@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
364993f0d8
commit
5b8a826771
Vendored
+29
-9
@@ -1,4 +1,4 @@
|
||||
// Axios v1.7.6 Copyright (c) 2024 Matt Zabriskie and contributors
|
||||
// Axios v1.7.7 Copyright (c) 2024 Matt Zabriskie and contributors
|
||||
'use strict';
|
||||
|
||||
function bind(fn, thisArg) {
|
||||
@@ -2699,14 +2699,34 @@ const streamChunk = function* (chunk, chunkSize) {
|
||||
}
|
||||
};
|
||||
|
||||
const readBytes = async function* (iterable, chunkSize, encode) {
|
||||
for await (const chunk of iterable) {
|
||||
yield* streamChunk(ArrayBuffer.isView(chunk) ? chunk : (await encode(String(chunk))), chunkSize);
|
||||
const readBytes = async function* (iterable, chunkSize) {
|
||||
for await (const chunk of readStream(iterable)) {
|
||||
yield* streamChunk(chunk, chunkSize);
|
||||
}
|
||||
};
|
||||
|
||||
const trackStream = (stream, chunkSize, onProgress, onFinish, encode) => {
|
||||
const iterator = readBytes(stream, chunkSize, encode);
|
||||
const readStream = async function* (stream) {
|
||||
if (stream[Symbol.asyncIterator]) {
|
||||
yield* stream;
|
||||
return;
|
||||
}
|
||||
|
||||
const reader = stream.getReader();
|
||||
try {
|
||||
for (;;) {
|
||||
const {done, value} = await reader.read();
|
||||
if (done) {
|
||||
break;
|
||||
}
|
||||
yield value;
|
||||
}
|
||||
} finally {
|
||||
await reader.cancel();
|
||||
}
|
||||
};
|
||||
|
||||
const trackStream = (stream, chunkSize, onProgress, onFinish) => {
|
||||
const iterator = readBytes(stream, chunkSize);
|
||||
|
||||
let bytes = 0;
|
||||
let done;
|
||||
@@ -2886,7 +2906,7 @@ var fetchAdapter = isFetchSupported && (async (config) => {
|
||||
progressEventReducer(asyncDecorator(onUploadProgress))
|
||||
);
|
||||
|
||||
data = trackStream(_request.body, DEFAULT_CHUNK_SIZE, onProgress, flush, encodeText);
|
||||
data = trackStream(_request.body, DEFAULT_CHUNK_SIZE, onProgress, flush);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2929,7 +2949,7 @@ var fetchAdapter = isFetchSupported && (async (config) => {
|
||||
trackStream(response.body, DEFAULT_CHUNK_SIZE, onProgress, () => {
|
||||
flush && flush();
|
||||
unsubscribe && unsubscribe();
|
||||
}, encodeText),
|
||||
}),
|
||||
options
|
||||
);
|
||||
}
|
||||
@@ -3113,7 +3133,7 @@ function dispatchRequest(config) {
|
||||
});
|
||||
}
|
||||
|
||||
const VERSION = "1.7.6";
|
||||
const VERSION = "1.7.7";
|
||||
|
||||
const validators$1 = {};
|
||||
|
||||
|
||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user