From a58f7fec4e50ff13400f63f938723efc56db950b Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Fri, 5 Aug 2022 09:55:24 -0400 Subject: [PATCH] *Remove slice --- src/rpc.ts | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/src/rpc.ts b/src/rpc.ts index 3eff9bb..f9ed90f 100644 --- a/src/rpc.ts +++ b/src/rpc.ts @@ -299,20 +299,18 @@ class RPCConnection { ) as AsyncIterable; const emptyData = Uint8Array.from([]); const streamResp = { - result: { - data: { - data: emptyData, - done: false, - } as StreamFileResponse, - }, + data: { + data: emptyData, + done: false, + } as StreamFileResponse, }; for await (const chunk of stream) { - streamResp.result.data.data = chunk.slice() as unknown as Uint8Array; + streamResp.data.data = chunk as unknown as Uint8Array; that.write(pack(streamResp)); } - streamResp.result.data.data = emptyData; - streamResp.result.data.done = true; + streamResp.data.data = emptyData; + streamResp.data.done = true; response = streamResp; }