Skip to content

Commit 35bddd6

Browse files
Fix function for old js (#2523)
1 parent 34be385 commit 35bddd6

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

.changeset/mighty-balloons-suffer.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@thirdweb-dev/crypto": patch
3+
---
4+
5+
Fix function for old js

packages/crypto/src/utils/uint8array-extras.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,12 @@ export function concatUint8Arrays(arrays, totalLength) {
4141
return new Uint8Array(0);
4242
}
4343

44-
totalLength ??= arrays.reduce(
45-
(accumulator, currentValue) => accumulator + currentValue.length,
46-
0,
47-
);
44+
if (totalLength === null || totalLength === undefined) {
45+
totalLength = arrays.reduce(
46+
(accumulator, currentValue) => accumulator + currentValue.length,
47+
0,
48+
);
49+
}
4850

4951
const returnValue = new Uint8Array(totalLength);
5052

0 commit comments

Comments
 (0)