dk-frontend-skills 3.0.5 → 3.0.6
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/package.json +1 -1
- package/scripts/core.js +3 -2
package/package.json
CHANGED
package/scripts/core.js
CHANGED
|
@@ -242,10 +242,11 @@ async function downloadFile(url, destPath, onProgress) {
|
|
|
242
242
|
if (done) break;
|
|
243
243
|
downloaded += value.length;
|
|
244
244
|
if (onProgress) onProgress(downloaded, total);
|
|
245
|
-
writer.write(value);
|
|
245
|
+
const ok = writer.write(value);
|
|
246
|
+
if (!ok) await new Promise((resolve) => writer.once("drain", resolve));
|
|
246
247
|
}
|
|
247
248
|
} finally {
|
|
248
|
-
writer.
|
|
249
|
+
await new Promise((resolve) => writer.end(resolve));
|
|
249
250
|
}
|
|
250
251
|
|
|
251
252
|
// 下载完后校验 gzip 格式
|