⛄ Sync 2026-07-24 20:33:21

This commit is contained in:
github-actions[bot] committed 2026-07-24 20:33:21 +08:00
1 parent 17e81fce20
commit 92bf601d26
25 files changed
+148 -134

No files matched your search

@@ -120,8 +120,11 @@ return baseclass.extend({
let promise = Promise.resolve();
for(let offset = 0; offset < bytes.length; offset += chunkSize) {
const chunkBytes = bytes.slice(offset, Math.min(offset + chunkSize, bytes.length));
const chunk = decoder.decode(chunkBytes);
const chunkStart = offset;
const chunkEnd = Math.min(offset + chunkSize, bytes.length);
const isLastChunk = chunkEnd === bytes.length;
const chunkBytes = bytes.slice(chunkStart, chunkEnd);
const chunk = decoder.decode(chunkBytes, { stream: !isLastChunk });
const append = offset > 0;
promise = promise.then(() => callFileWrite(path, chunk, append, mode));
}