/**\r
* Listens for messages from a calling function.\r
*/\r
- if (typeof addEventListener === 'function') {\r
- addEventListener('message', (message: any): void => {\r
- const data = JSON.parse(new TextDecoder().decode(message.data ?? message))\r
- for (const d of data) {\r
- d.publicKey = convert(d.privateKey)\r
- }\r
- const buf = new TextEncoder().encode(JSON.stringify(data)).buffer\r
- //@ts-expect-error\r
- postMessage(buf, [buf])\r
- })\r
- }\r
+ addEventListener('message', (message: any): void => {\r
+ const data = JSON.parse(new TextDecoder().decode(message.data ?? message))\r
+ for (const d of data) {\r
+ d.publicKey = convert(d.privateKey)\r
+ }\r
+ const buf = new TextEncoder().encode(JSON.stringify(data)).buffer\r
+ //@ts-expect-error\r
+ postMessage(buf, [buf])\r
+ })\r
\r
const gf = function (init?: number[]): Float64Array {\r
const r = new Float64Array(16)\r