feat: add file preview modal (#945)

This commit is contained in:
Aman Harwara
2022-03-24 00:13:44 +05:30
committed by GitHub
parent 8715a8b8f4
commit 12e3bb0959
15 changed files with 445 additions and 135 deletions

View File

@@ -0,0 +1,14 @@
export const concatenateUint8Arrays = (arrays: Uint8Array[]) => {
const totalLength = arrays
.map((array) => array.length)
.reduce((prev, next) => prev + next, 0);
const concatenatedArray = new Uint8Array(totalLength);
let offset = 0;
arrays.forEach((array) => {
concatenatedArray.set(array, offset);
offset += array.length;
});
return concatenatedArray;
};