Skip to content

Commit e716795

Browse files
committed
go back to simpler stream handling
1 parent dba172c commit e716795

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

packages/hub/src/utils/XetBlob.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -284,11 +284,7 @@ export class XetBlob extends Blob {
284284
const result = await iterator.next();
285285

286286
if (result.value) {
287-
// Split into chunks of 1000 bytes since `ByteLengthQueuingStrategy` fails in Node.js due to size being a function
288-
const chunkSize = 1_000;
289-
for (let i = 0; i < result.value.length; i += chunkSize) {
290-
controller.enqueue(result.value.slice(i, i + chunkSize));
291-
}
287+
controller.enqueue(result.value);
292288
}
293289

294290
if (result.done) {
@@ -298,7 +294,7 @@ export class XetBlob extends Blob {
298294
type: "bytes",
299295
// todo: when Safari supports it, add autoAllocateChunkSize param
300296
},
301-
// todo : use ByteLengthQueuingStrategy when there's good support for it
297+
// todo : use ByteLengthQueuingStrategy when there's good support for it, currently in Node.js it fails due to size being a function
302298
{
303299
highWaterMark: 1_000, // 1_000 chunks for ~1MB of RAM
304300
}

0 commit comments

Comments
 (0)