vovk 3.0.0-draft.143 → 3.0.0-draft.145
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -26,9 +26,11 @@ const defaultStreamHandler = async (response) => {
|
|
|
26
26
|
let prepend = '';
|
|
27
27
|
while (true) {
|
|
28
28
|
let value;
|
|
29
|
-
let done = false;
|
|
30
29
|
try {
|
|
30
|
+
let done = false;
|
|
31
31
|
({ value, done } = await reader.read());
|
|
32
|
+
if (done)
|
|
33
|
+
break;
|
|
32
34
|
}
|
|
33
35
|
catch (error) {
|
|
34
36
|
await reader.cancel();
|
|
@@ -36,9 +38,6 @@ const defaultStreamHandler = async (response) => {
|
|
|
36
38
|
err.cause = error;
|
|
37
39
|
throw err;
|
|
38
40
|
}
|
|
39
|
-
if (done) {
|
|
40
|
-
return;
|
|
41
|
-
}
|
|
42
41
|
// typeof value === 'number' is a workaround for React Native
|
|
43
42
|
const string = typeof value === 'number' ? String.fromCharCode(value) : new TextDecoder().decode(value);
|
|
44
43
|
prepend += string;
|
|
@@ -26,9 +26,11 @@ const defaultStreamHandler = async (response) => {
|
|
|
26
26
|
let prepend = '';
|
|
27
27
|
while (true) {
|
|
28
28
|
let value;
|
|
29
|
-
let done = false;
|
|
30
29
|
try {
|
|
30
|
+
let done = false;
|
|
31
31
|
({ value, done } = await reader.read());
|
|
32
|
+
if (done)
|
|
33
|
+
break;
|
|
32
34
|
}
|
|
33
35
|
catch (error) {
|
|
34
36
|
await reader.cancel();
|
|
@@ -36,9 +38,6 @@ const defaultStreamHandler = async (response) => {
|
|
|
36
38
|
err.cause = error;
|
|
37
39
|
throw err;
|
|
38
40
|
}
|
|
39
|
-
if (done) {
|
|
40
|
-
return;
|
|
41
|
-
}
|
|
42
41
|
// typeof value === 'number' is a workaround for React Native
|
|
43
42
|
const string = typeof value === 'number' ? String.fromCharCode(value) : new TextDecoder().decode(value);
|
|
44
43
|
prepend += string;
|