//@ts-expect-error
worker: new Worker(url, { type: 'module', eval: true })
}
- thread.worker.addEventListener('message', (message) => {
- let result = JSON.parse(new TextDecoder().decode(message.data ?? message))
+ thread.worker.addEventListener('message', message => {
+ const data = new TextDecoder().decode(message.data ?? message)
+ let result = JSON.parse(data || "[]")
if (!Array.isArray(result)) result = [result]
this.#report(thread, result)
})