mirror of
https://github.com/kiddin9/op-packages.git
synced 2026-10-31 01:35:13 +08:00
⛄ Sync 2026-07-24 20:33:21
This commit is contained in:
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));
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user