(event: string, cb: (...args: any[]) => void)
| 49 | setTimeout(() => { if (this.alive && readyOk !== null) this.emitMessage({ type: 'ready', ok: readyOk }); }, 0); |
| 50 | } |
| 51 | on(event: string, cb: (...args: any[]) => void): void { |
| 52 | if (event === 'message') this.msgCb = cb; |
| 53 | else if (event === 'exit') this.exitCb = cb; |
| 54 | else if (event === 'error') this.errorCb = cb; |
| 55 | } |
| 56 | emitMessage(m: unknown): void { this.msgCb?.(m); } |
| 57 | emitError(): void { this.errorCb?.(new Error('worker failed')); } |
| 58 | emitExit(): void { this.exitCb?.(13); } |
nothing calls this directly
no outgoing calls
no test coverage detected