*Remove slice
This commit is contained in:
parent
80c48b3a1c
commit
a58f7fec4e
16
src/rpc.ts
16
src/rpc.ts
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue