fix: fix default worker data value
[poolifier.git] / src / pools / abstract-pool.ts
index 695c43b30d3f6697a5407a60ff3ceeca05248350..6531d6615349bda3b7223329977963ee7eba95a5 100644 (file)
@@ -2,8 +2,8 @@ import type {
   MessageValue,
   PromiseWorkerResponseWrapper
 } from '../utility-types'
-import { EMPTY_FUNCTION, EMPTY_OBJECT_LITERAL } from '../utils'
-import { isKillBehavior, KillBehaviors } from '../worker/worker-options'
+import { EMPTY_FUNCTION } from '../utils'
+import { KillBehaviors, isKillBehavior } from '../worker/worker-options'
 import type { PoolOptions } from './pool'
 import { PoolEmitter } from './pool'
 import type { IPoolInternal, TasksUsage } from './pool-internal'
@@ -208,7 +208,8 @@ export abstract class AbstractPool<
     const res = this.internalExecute(worker, this.nextMessageId)
     this.checkAndEmitBusy()
     this.sendToWorker(worker, {
-      data: data ?? (EMPTY_OBJECT_LITERAL as Data),
+      // eslint-disable-next-line @typescript-eslint/consistent-type-assertions
+      data: data ?? ({} as Data),
       id: this.nextMessageId
     })
     ++this.nextMessageId