1 export default function mergeUint8Arrays(arrays: Uint8Array[]) {
2 const length = arrays.reduce((sum, arr) => sum + arr.length, 0);
3 const chunksAll = new Uint8Array(length);
4 arrays.reduce((position, arr) => {
5 chunksAll.set(arr, position);
6 return position + arr.length;