From e5a5c0fc68a38b7d6316cc573c34313aa6ec30e9 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Sat, 18 Mar 2023 18:34:43 +0100 Subject: [PATCH] fix: fix default worker data value MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- .eslintrc.js | 1 + src/pools/abstract-pool.ts | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.eslintrc.js b/.eslintrc.js index 6dcbf08c..4852d04f 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -42,6 +42,7 @@ module.exports = defineConfig({ 'ctx', 'ecma', 'enum', + 'esm', 'fibonacci', 'fs', 'inheritDoc', diff --git a/src/pools/abstract-pool.ts b/src/pools/abstract-pool.ts index 3cb6c1f7..6531d661 100644 --- a/src/pools/abstract-pool.ts +++ b/src/pools/abstract-pool.ts @@ -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 -- 2.34.1