From fb78b448a53ba7f191447cbdd48e50fbfde16a48 Mon Sep 17 00:00:00 2001 From: Chris Duncan Date: Thu, 12 Dec 2024 13:26:13 -0800 Subject: [PATCH] Worker result is always currently returned as buffer so fix handling. --- src/lib/pool.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/lib/pool.ts b/src/lib/pool.ts index ca3277c..9431f2f 100644 --- a/src/lib/pool.ts +++ b/src/lib/pool.ts @@ -33,9 +33,7 @@ export class Pool { job: null } thread.worker.addEventListener('message', message => { - let result = (message.data instanceof ArrayBuffer) - ? new Uint8Array(message.data) - : JSON.parse(new TextDecoder().decode(message.data) || "[]") + let result = JSON.parse(new TextDecoder().decode(message.data) || "[]") if (!Array.isArray(result)) result = [result] this.#report(thread, result) }) -- 2.34.1