Skip to content

Commit cc1826e

Browse files
committed
fix: Uint8Array<ArrayBufferLike> to ArrayBuffer via buffer.slice
1 parent a6343fa commit cc1826e

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,8 @@ class RemoteExecutor implements QueryExecutor {
178178
while (true) {
179179
const { done, value } = await reader.read();
180180
if (done) break;
181-
pending = pending.length > 0 ? concat(pending, new Uint8Array(value)) : new Uint8Array(value);
181+
const chunk = new Uint8Array(value.buffer.slice(value.byteOffset, value.byteOffset + value.byteLength));
182+
pending = pending.length > 0 ? concat(pending, chunk) : chunk;
182183

183184
// Process complete frames
184185
while (pending.length >= 4) {

0 commit comments

Comments
 (0)