template-replacement 3.3.2 → 3.3.3

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/worker/index.ts CHANGED
@@ -28,13 +28,15 @@ export default class worker implements DispatcherInterface {
28
28
  #addOneWorker(webworker: webworker) {
29
29
  const worker: Worker = new webworker()
30
30
  worker.onmessage = async (event: MessageEvent) => {
31
- const tasks = []
31
+ const tasks: unknown[] = []
32
32
  for (const fun of this.#listenerList) {
33
33
  tasks.push(fun(event))
34
34
  }
35
35
  const res = await Promise.all(tasks)
36
36
  for (const reply of res) {
37
- reply as any && worker.postMessage(reply)
37
+ if (reply) {
38
+ worker.postMessage(reply)
39
+ }
38
40
  }
39
41
  }
40
42
  this.#workers.push(worker)