From 898692049c1f5b26941eec2cb66a57933b6c1988 Mon Sep 17 00:00:00 2001 From: KATT Date: Fri, 6 Oct 2023 10:54:32 +0200 Subject: [PATCH] stream --- src/async/deserializeAsync.test.ts | 18 +++++++++--------- src/async/deserializeAsync.ts | 1 + 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/src/async/deserializeAsync.test.ts b/src/async/deserializeAsync.test.ts index d3ddb8c4..289113d9 100644 --- a/src/async/deserializeAsync.test.ts +++ b/src/async/deserializeAsync.test.ts @@ -20,18 +20,18 @@ test("deserialize promise", async () => { types: [tsonAsyncIterator, tsonPromise, tsonBigint], }); - // { - // // plain obj - // const obj = { - // foo: "bar", - // }; + { + // plain obj + const obj = { + foo: "bar", + }; - // const strIterable = tson.stringify(obj); + const strIterable = tson.stringify(obj); - // const result = await tson.parse(strIterable); + const result = await tson.parse(strIterable); - // expect(result).toEqual(obj); - // } + expect(result).toEqual(obj); + } { // promise diff --git a/src/async/deserializeAsync.ts b/src/async/deserializeAsync.ts index 8abd837d..1ba62f8f 100644 --- a/src/async/deserializeAsync.ts +++ b/src/async/deserializeAsync.ts @@ -133,6 +133,7 @@ export function createTsonParseAsyncInner(opts: TsonAsyncOptions) { assert(item, `No stream found for index ${index}`); // FIXME: I don't know why this requires array buffer + // eslint-disable-next-line @typescript-eslint/no-unsafe-argument item.controller.enqueue(walkedResult as any); }