]> zoso.dev Git - libnemo.git/commitdiff
Look into replacing Node test runner with browser-based tool. Remove Node workarounds...
authorChris Duncan <chris@zoso.dev>
Tue, 26 Nov 2024 13:41:04 +0000 (05:41 -0800)
committerChris Duncan <chris@zoso.dev>
Tue, 26 Nov 2024 13:41:04 +0000 (05:41 -0800)
src/lib/workers.ts
src/lib/workers/ckdBip44.ts
src/lib/workers/ckdBlake2b.ts

index 8828c7dc38b5ec07c09a3a625e92a2628c616b00..20feaa375259b93ab3ca78cccd0da0cef03c9380 100644 (file)
@@ -1,5 +1,5 @@
 import ckdBip44 from './workers/ckdBip44.js'
 import ckdBlake2b from './workers/ckdBlake2b.js'
-export { ckdBip44, ckdBlake2b }
 // import './workers/nano-nacl.js'
 // import './workers/passkey.js'
+export { ckdBip44, ckdBlake2b }
index 56a48c72a2793281b204ba0f56a674aa6b51a908..95b3b9b930863b5175c5e64dd6ce53811716a8bd 100644 (file)
@@ -10,15 +10,6 @@ const BIP44_COIN_NANO = 165
 const BIP44_PURPOSE = 44
 const HARDENED_OFFSET = 0x80000000
 const SLIP10_ED25519 = 'ed25519 seed'
-let addEventListener = globalThis.addEventListener
-let postMessage = globalThis.postMessage
-if (addEventListener == null || postMessage == null) {
-       const { isMainThread, parentPort } = await import('node:worker_threads')
-       if (!isMainThread && parentPort) {
-               addEventListener = Object.getPrototypeOf(parentPort).addListener.bind(parentPort)
-               postMessage = Object.getPrototypeOf(parentPort).postMessage.bind(parentPort)
-       }
-}
 
 /**
 * Listens for messages from a calling function.
index 10a477da8827b891d315149ebb9f8e412438b438..6f27858f104409f9c8d823ba00851aed408f33cd 100644 (file)
@@ -3,16 +3,6 @@
 
 import blake2b from 'blake2b'
 
-let addEventListener = globalThis.addEventListener
-let postMessage = globalThis.postMessage
-if (addEventListener == null || postMessage == null) {
-       const { isMainThread, parentPort } = await import('node:worker_threads')
-       if (!isMainThread && parentPort) {
-               addEventListener = Object.getPrototypeOf(parentPort).addListener.bind(parentPort)
-               postMessage = Object.getPrototypeOf(parentPort).postMessage.bind(parentPort)
-       }
-}
-
 /**
 * Listens for messages from a calling function.
 */