Skip to content

Commit

Permalink
Improve worker function parse
Browse files Browse the repository at this point in the history
  • Loading branch information
Namide committed Oct 11, 2024
1 parent 5d49601 commit a3df8ca
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,12 @@ onmessage = (message) => {
] = message.data as Parameters<typeof extractColors>;
extractColors(
picture,
[_pixels, _distance, eval(`(${_colorValidatorStr})`), ..._cleanInputsRest],
[
_pixels,
_distance,
Function(`return ${_colorValidatorStr}`)(),
..._cleanInputsRest,
],
postMessage
);
};

0 comments on commit a3df8ca

Please sign in to comment.