]> Piment Noir Git Repositories - poolifier.git/commitdiff
perf: remove unneeded null check at building abortable task function master
authorJérôme Benoit <jerome.benoit@piment-noir.org>
Sat, 5 Jul 2025 17:49:36 +0000 (19:49 +0200)
committerJérôme Benoit <jerome.benoit@piment-noir.org>
Sat, 5 Jul 2025 17:49:36 +0000 (19:49 +0200)
Signed-off-by: Jérôme Benoit <jerome.benoit@piment-noir.org>
src/worker/abstract-worker.ts

index 0bcc8757db4b3f76baab33bf7668a020d8a8fa29..f3c36bceb9394991c04f2a776dfcf107d9da3900 100644 (file)
@@ -677,7 +677,8 @@ export abstract class AbstractWorker<
           this.taskAbortFunctions.set(taskId, () => {
             reject(new AbortError(`Task '${name}' id '${taskId}' aborted`))
           })
-          const taskFunction = this.taskFunctions.get(name)?.taskFunction
+          // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
+          const taskFunction = this.taskFunctions.get(name)!.taskFunction
           if (isAsyncFunction(taskFunction)) {
             ;(taskFunction as TaskAsyncFunction<Data, Response>)(data)
               .then(resolve)