*Remove slice

This commit is contained in:
Derrick Hammer 2022-08-05 09:55:24 -04:00
parent 80c48b3a1c
commit a58f7fec4e
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
1 changed files with 7 additions and 9 deletions

View File

@ -299,20 +299,18 @@ class RPCConnection {
) as AsyncIterable<Uint8Array>; ) as AsyncIterable<Uint8Array>;
const emptyData = Uint8Array.from([]); const emptyData = Uint8Array.from([]);
const streamResp = { const streamResp = {
result: { data: {
data: { data: emptyData,
data: emptyData, done: false,
done: false, } as StreamFileResponse,
} as StreamFileResponse,
},
}; };
for await (const chunk of stream) { 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)); that.write(pack(streamResp));
} }
streamResp.result.data.data = emptyData; streamResp.data.data = emptyData;
streamResp.result.data.done = true; streamResp.data.done = true;
response = streamResp; response = streamResp;
} }