Skip to content

Commit 920e036

Browse files
committed
Fixes build error
1 parent 111606e commit 920e036

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/common/utils/fileUtils.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,15 @@ export async function downloadFile(params: {
5454
const error = new Error("Maximum file size exceeded");
5555
error.name = ErrorName.MAX_FILE_SIZE_EXCEEDED;
5656
throw error;
57+
}
58+
const allBytes = new Uint8Array(totalBytes);
59+
let offset = 0;
60+
for (const chunk of chunks) {
61+
allBytes.set(chunk, offset);
62+
offset += chunk.length;
5763
}
58-
const blob = new Blob(chunks);
59-
const arrayBuffer = await blob.arrayBuffer();
6064
const decoder = new TextDecoder();
61-
return decoder.decode(arrayBuffer);
65+
return decoder.decode(allBytes);
6266
}
6367

6468
export function checkIfJsonOrYaml(fileText: string) {

0 commit comments

Comments
 (0)