Skip to content

Commit

Permalink
[comlink-everywhere] Remove eval arg.
Browse files Browse the repository at this point in the history
  • Loading branch information
lgarron committed Aug 27, 2024
1 parent 7944e0b commit 9521f7c
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions src/cubing/vendor/apache/comlink-everywhere/outside/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,12 @@ async function nodeWorker(

export async function constructWorker(
source: string | URL,
options?: { eval?: boolean; type?: WorkerType },
options?: { type?: WorkerType },
): Promise<Worker> {
let worker: Worker;
if (useNodeWorkarounds) {
return nodeWorker(source, { eval: options?.eval });
return nodeWorker(source);
} else {
if (options?.eval) {
const blob = new Blob([source as string], {
type: "application/javascript",
});
source = URL.createObjectURL(blob);
}
worker = new globalThis.Worker(source, {
type: options ? options.type : undefined, // TODO: Is it safe to use `options?.type`?
});
Expand Down

0 comments on commit 9521f7c

Please sign in to comment.