refactor: cleanup type casting
authorJérôme Benoit <jerome.benoit@piment-noir.org>
Fri, 31 May 2024 18:31:06 +0000 (20:31 +0200)
committerJérôme Benoit <jerome.benoit@piment-noir.org>
Fri, 31 May 2024 18:31:06 +0000 (20:31 +0200)
Signed-off-by: Jérôme Benoit <jerome.benoit@piment-noir.org>
src/worker/abstract-worker.ts

index ac6e66795753809c9f84442ae891b98f78f98aa6..ec77ccab8d68c7990339b9331cf6fd4903a7d1fe 100644 (file)
@@ -399,7 +399,7 @@ export abstract class AbstractWorker<
   protected handleKillMessage (message: MessageValue<Data>): void {
     this.stopCheckActive()
     if (isAsyncFunction(this.opts.killHandler)) {
-      ;(this.opts.killHandler() as Promise<void>)
+      ;(this.opts.killHandler as () => Promise<void>)()
         .then(() => {
           this.sendToMainWorker({ kill: 'success' })
           return undefined