@e-mc/compress 0.8.26 → 0.8.27

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/README.md CHANGED
@@ -9,7 +9,7 @@
9
9
 
10
10
  ## Interface
11
11
 
12
- - https://www.unpkg.com/@e-mc/types@0.8.26/lib/index.d.ts
12
+ - https://www.unpkg.com/@e-mc/types@0.8.27/lib/index.d.ts
13
13
 
14
14
  ```typescript
15
15
  import type { CompressLevel } from "./squared";
@@ -51,9 +51,9 @@ interface CompressConstructor extends ModuleConstructor {
51
51
 
52
52
  ## References
53
53
 
54
- - https://www.unpkg.com/@e-mc/types@0.8.26/lib/squared.d.ts
55
- - https://www.unpkg.com/@e-mc/types@0.8.26/lib/compress.d.ts
56
- - https://www.unpkg.com/@e-mc/types@0.8.26/lib/settings.d.ts
54
+ - https://www.unpkg.com/@e-mc/types@0.8.27/lib/squared.d.ts
55
+ - https://www.unpkg.com/@e-mc/types@0.8.27/lib/compress.d.ts
56
+ - https://www.unpkg.com/@e-mc/types@0.8.27/lib/settings.d.ts
57
57
 
58
58
  ## LICENSE
59
59
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@e-mc/compress",
3
- "version": "0.8.26",
3
+ "version": "0.8.27",
4
4
  "description": "Compress constructor for E-mc.",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -23,8 +23,8 @@
23
23
  "license": "MIT",
24
24
  "homepage": "https://github.com/anpham6/e-mc#readme",
25
25
  "dependencies": {
26
- "@e-mc/module": "0.8.26",
27
- "@e-mc/types": "0.8.26",
26
+ "@e-mc/module": "0.8.27",
27
+ "@e-mc/types": "0.8.27",
28
28
  "tinify": "^1.8.0",
29
29
  "wawoff2": "^2.0.1",
30
30
  "woff2sfnt-sfnt2woff": "^1.0.0"
@@ -3,11 +3,20 @@ const node_worker_threads_1 = require("node:worker_threads");
3
3
  const { toWoff } = require('woff2sfnt-sfnt2woff');
4
4
  const PORT = node_worker_threads_1.workerData[0];
5
5
  node_worker_threads_1.parentPort.on('message', (value) => {
6
+ let data = null;
6
7
  try {
7
- const data = toWoff(value);
8
+ data = toWoff(value);
8
9
  PORT.postMessage(data, [data.buffer]);
9
10
  }
10
11
  catch (err) {
12
+ if (data) {
13
+ try {
14
+ PORT.postMessage(data);
15
+ return;
16
+ }
17
+ catch {
18
+ }
19
+ }
11
20
  console.error(err);
12
21
  PORT.postMessage(null);
13
22
  }
@@ -3,11 +3,20 @@ const node_worker_threads_1 = require("node:worker_threads");
3
3
  const { toSfnt } = require('woff2sfnt-sfnt2woff');
4
4
  const PORT = node_worker_threads_1.workerData[0];
5
5
  node_worker_threads_1.parentPort.on('message', (value) => {
6
+ let data = null;
6
7
  try {
7
- const data = toSfnt(value);
8
+ data = toSfnt(value);
8
9
  PORT.postMessage(data, [data.buffer]);
9
10
  }
10
11
  catch (err) {
12
+ if (data) {
13
+ try {
14
+ PORT.postMessage(data);
15
+ return;
16
+ }
17
+ catch {
18
+ }
19
+ }
11
20
  console.error(err);
12
21
  PORT.postMessage(null);
13
22
  }