fix: fix default worker data value
authorJérôme Benoit <jerome.benoit@sap.com>
Sat, 18 Mar 2023 17:34:43 +0000 (18:34 +0100)
committerJérôme Benoit <jerome.benoit@sap.com>
Sat, 18 Mar 2023 17:34:43 +0000 (18:34 +0100)
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
.eslintrc.js
src/pools/abstract-pool.ts

index 6dcbf08c555060355cb041c17d01eb5f1e60a85e..4852d04fd263b188492175c995457cd389974db2 100644 (file)
@@ -42,6 +42,7 @@ module.exports = defineConfig({
           'ctx',
           'ecma',
           'enum',
+          'esm',
           'fibonacci',
           'fs',
           'inheritDoc',
index 3cb6c1f7a7b034086e6e20a56635c44f1d8af0f2..6531d6615349bda3b7223329977963ee7eba95a5 100644 (file)
@@ -208,7 +208,8 @@ export abstract class AbstractPool<
     const res = this.internalExecute(worker, this.nextMessageId)
     this.checkAndEmitBusy()
     this.sendToWorker(worker, {
-      data,
+      // eslint-disable-next-line @typescript-eslint/consistent-type-assertions
+      data: data ?? ({} as Data),
       id: this.nextMessageId
     })
     ++this.nextMessageId