Skip to content

Commit 471f6cc

Browse files
committed
fix: replaced deprecated usage of buffer.slice with buffer.subarray
[ci skip]
1 parent 1f5de39 commit 471f6cc

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/QUICStream.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -462,7 +462,7 @@ class QUICStream implements ReadableWritablePair<Uint8Array, Uint8Array> {
462462
if (recvLength > 0) {
463463
this.readableController.enqueue(
464464
// Making a copy to be enqueued
465-
Buffer.from(this.readableChunk!.slice(0, recvLength)),
465+
Buffer.from(this.readableChunk!.subarray(0, recvLength)),
466466
);
467467
}
468468
this.readableController.close();
@@ -626,7 +626,7 @@ class QUICStream implements ReadableWritablePair<Uint8Array, Uint8Array> {
626626
if (recvLength > 0) {
627627
this.readableController.enqueue(
628628
// Making a copy to be enqueued
629-
Buffer.from(this.readableChunk!.slice(0, recvLength)),
629+
Buffer.from(this.readableChunk!.subarray(0, recvLength)),
630630
);
631631
}
632632
if (fin) {

0 commit comments

Comments
 (0)