Skip to content

fix(bytes): allow to concat() readonly arrays of bytes arrays #6639

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 5, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion bytes/concat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export type { Uint8Array_ };
* assertEquals(concat([a, b]), new Uint8Array([0, 1, 2, 3, 4, 5]));
* ```
*/
export function concat(buffers: Uint8Array[]): Uint8Array_ {
export function concat(buffers: readonly Uint8Array[]): Uint8Array_ {
let length = 0;
for (const buffer of buffers) {
length += buffer.length;
Expand Down
2 changes: 1 addition & 1 deletion bytes/concat_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Deno.test("concat() handles multiple Uint8Array", () => {
});

Deno.test("concat() handles an array of Uint8Array", () => {
const a = [
const a: readonly Uint8Array[] = [
new Uint8Array([0, 1, 2, 3]),
new Uint8Array([4, 5, 6]),
new Uint8Array([7, 8, 9]),
Expand Down
Loading