build-dxf 0.0.20-17 → 0.0.20-19
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/src/build.js +6 -2
package/package.json
CHANGED
package/src/build.js
CHANGED
|
@@ -1380,7 +1380,11 @@ class X extends j {
|
|
|
1380
1380
|
i.toBlob((a) => {
|
|
1381
1381
|
c(a);
|
|
1382
1382
|
}, e, 1);
|
|
1383
|
-
}) :
|
|
1383
|
+
}) : new Promise((c) => {
|
|
1384
|
+
i.toBuffer((a, h) => {
|
|
1385
|
+
console.error(a), c(h);
|
|
1386
|
+
}, e);
|
|
1387
|
+
});
|
|
1384
1388
|
}
|
|
1385
1389
|
/**
|
|
1386
1390
|
* 将点json结构转换为Dxf string
|
|
@@ -1424,7 +1428,7 @@ class X extends j {
|
|
|
1424
1428
|
if (typeof window < "u") {
|
|
1425
1429
|
const o = document.createElement("a");
|
|
1426
1430
|
o.href = URL.createObjectURL(i), o.download = t, o.click();
|
|
1427
|
-
} else typeof global < "u"
|
|
1431
|
+
} else typeof global < "u" ? (await G("fs", !1)).writeFileSync(t, i) : console.error("图片下载失败");
|
|
1428
1432
|
return !0;
|
|
1429
1433
|
}
|
|
1430
1434
|
/**
|