Skip to content

Commit c338b2f

Browse files
authored
fix(bytes): allow to concat() readonly arrays of bytes arrays (#6639)
1 parent fc46aad commit c338b2f

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

bytes/concat.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export type { Uint8Array_ };
2121
* assertEquals(concat([a, b]), new Uint8Array([0, 1, 2, 3, 4, 5]));
2222
* ```
2323
*/
24-
export function concat(buffers: Uint8Array[]): Uint8Array_ {
24+
export function concat(buffers: readonly Uint8Array[]): Uint8Array_ {
2525
let length = 0;
2626
for (const buffer of buffers) {
2727
length += buffer.length;

bytes/concat_test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ Deno.test("concat() handles multiple Uint8Array", () => {
3636
});
3737

3838
Deno.test("concat() handles an array of Uint8Array", () => {
39-
const a = [
39+
const a: readonly Uint8Array[] = [
4040
new Uint8Array([0, 1, 2, 3]),
4141
new Uint8Array([4, 5, 6]),
4242
new Uint8Array([7, 8, 9]),

0 commit comments

Comments
 (0)