if (typeof taskId !== 'string') return
BROWSER: if (taskUrl !== location.href) return
NODE: if (taskUrl !== dec.toString(threadId)) return
- NODE: if (parentPort == null) setTimeout(() => listener(event), 0)
+ NODE: if (parentPort == null) return void setTimeout(() => listener(event), 0)
const action = parseAction(data)
const keySalt = parseKeySalt(action, data)
const type = parseType(action, data)
.then((key: CryptoKey | undefined): Promise<Record<string, boolean | number | ArrayBuffer> | void> => {
switch (action) {
case 'STOP': {
- BROWSER: close()
- NODE: process.exit()
- break
+ return process?.exit?.() ?? close()
}
case 'config': {
return config(timeout)