@clazic/kordoc 2.7.0 → 2.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -3112,7 +3112,7 @@ import JSZip2 from "jszip";
3112
3112
  import { DOMParser } from "@xmldom/xmldom";
3113
3113
 
3114
3114
  // src/utils.ts
3115
- var VERSION = true ? "2.6.1" : "0.0.0-dev";
3115
+ var VERSION = true ? "2.7.1" : "0.0.0-dev";
3116
3116
  function toArrayBuffer(buf) {
3117
3117
  if (buf.byteOffset === 0 && buf.byteLength === buf.buffer.byteLength) {
3118
3118
  return buf.buffer;
@@ -11307,13 +11307,17 @@ async function downloadWithProgress(url, dest, totalBytes, onProgress) {
11307
11307
  while (true) {
11308
11308
  const { done, value } = await reader.read();
11309
11309
  if (done) break;
11310
- file.write(value);
11310
+ if (!file.write(value)) {
11311
+ await new Promise((resolve4) => file.once("drain", resolve4));
11312
+ }
11311
11313
  downloaded += value.length;
11312
11314
  onProgress?.(downloaded, totalBytes);
11313
11315
  }
11314
11316
  } finally {
11315
- file.end();
11316
11317
  reader.releaseLock();
11318
+ await new Promise((resolve4, reject) => {
11319
+ file.end((err) => err ? reject(err) : resolve4());
11320
+ });
11317
11321
  }
11318
11322
  }
11319
11323
  async function installForPlatform(pkg, onProgress) {