build-dxf 0.0.20-17 → 0.0.20-18

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/build.js +6 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "build-dxf",
3
- "version": "0.0.20-17",
3
+ "version": "0.0.20-18",
4
4
  "description": "线段构建双线墙壁的dxf版本",
5
5
  "main": "./src/index.js",
6
6
  "types": "./src/index.d.ts",
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
- }) : i.toBuffer(e);
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" && (await G("fs", !1)).writeFileSync(t, i);
1431
+ } else typeof global < "u" ? (await G("fs", !1)).writeFileSync(t, i) : console.error("图片下载失败");
1428
1432
  return !0;
1429
1433
  }
1430
1434
  /**