Skip to content

Commit 8ca1d54

Browse files
chore(internal): avoid type checking errors with ts-reset
1 parent 1359bb7 commit 8ca1d54

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/client.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -581,7 +581,7 @@ export class Kernel {
581581
loggerFor(this).info(`${responseInfo} - ${retryMessage}`);
582582

583583
const errText = await response.text().catch((err: any) => castToError(err).message);
584-
const errJSON = safeJSON(errText);
584+
const errJSON = safeJSON(errText) as any;
585585
const errMessage = errJSON ? undefined : errText;
586586

587587
loggerFor(this).debug(

src/core/streaming.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ export class Stream<Item> implements AsyncIterable<Item> {
4646
try {
4747
for await (const sse of _iterSSEMessages(response, controller)) {
4848
try {
49-
yield JSON.parse(sse.data);
49+
yield JSON.parse(sse.data) as Item;
5050
} catch (e) {
5151
logger.error(`Could not parse message into JSON:`, sse.data);
5252
logger.error(`From chunk:`, sse.raw);
@@ -102,7 +102,7 @@ export class Stream<Item> implements AsyncIterable<Item> {
102102
try {
103103
for await (const line of iterLines()) {
104104
if (done) continue;
105-
if (line) yield JSON.parse(line);
105+
if (line) yield JSON.parse(line) as Item;
106106
}
107107
done = true;
108108
} catch (e) {

0 commit comments

Comments
 (0)