From: Jérôme Benoit Date: Sat, 19 Aug 2023 22:27:19 +0000 (+0200) Subject: refactor: stricter worker node constructor checks X-Git-Tag: v2.6.31~5 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=2d53d5ca71f78edd6f17ee976e87b4889f6c8bea;p=poolifier.git refactor: stricter worker node constructor checks Signed-off-by: Jérôme Benoit --- diff --git a/src/pools/worker-node.ts b/src/pools/worker-node.ts index 57628bf7..43c5de71 100644 --- a/src/pools/worker-node.ts +++ b/src/pools/worker-node.ts @@ -53,9 +53,9 @@ implements IWorkerNode { 'Cannot construct a worker node without a pool maximum size' ) } - if (isNaN(poolMaxSize)) { + if (!Number.isSafeInteger(poolMaxSize)) { throw new TypeError( - 'Cannot construct a worker node with a NaN pool maximum size' + 'Cannot construct a worker node with a pool maximum size that is not an integer' ) } this.worker = worker