diff --git a/src/async/deserializeAsync.ts b/src/async/deserializeAsync.ts index 9b5fd570..0b1ee9fc 100644 --- a/src/async/deserializeAsync.ts +++ b/src/async/deserializeAsync.ts @@ -155,7 +155,10 @@ export function createTsonParseAsyncInner(opts: TsonAsyncOptions) { item.controller.close(); } - assert(streamByIndex.size === 0, "Not all streams were closed"); + assert( + streamByIndex.size === 0, + "Not all streams were processed or done at the end of the stream", + ); } async function init() { diff --git a/src/handlers/tsonAsyncIterable.ts b/src/handlers/tsonAsyncIterable.ts index 625a2844..5576e637 100644 --- a/src/handlers/tsonAsyncIterable.ts +++ b/src/handlers/tsonAsyncIterable.ts @@ -36,7 +36,6 @@ export const tsonAsyncIterator: TsonAsyncType< case ITERATOR_VALUE: { yield value[1]; - break; } } } diff --git a/src/index.test.ts b/src/index.test.ts index 9623e816..a67fd440 100644 --- a/src/index.test.ts +++ b/src/index.test.ts @@ -178,6 +178,6 @@ test("async: bad values", async () => { }); expect(onErrorSpy.mock.calls[0][0]).toMatchInlineSnapshot( - '[TsonError: Stream interrupted: Not all streams were closed]', + '[TsonError: Stream interrupted: Not all streams were processed or done at the end of the stream]', ); });