chore: migrate to eslint 9
authorJérôme Benoit <jerome.benoit@piment-noir.org>
Thu, 30 May 2024 19:10:09 +0000 (21:10 +0200)
committerJérôme Benoit <jerome.benoit@piment-noir.org>
Thu, 30 May 2024 19:10:09 +0000 (21:10 +0200)
Signed-off-by: Jérôme Benoit <jerome.benoit@piment-noir.org>
134 files changed:
.eslintignore [deleted file]
.eslintrc.cjs [deleted file]
.lintstagedrc.js
.vscode/settings.json
benchmarks/benchmarks-types.cjs
benchmarks/benchmarks-utils.cjs
benchmarks/benchmarks-utils.mjs
benchmarks/internal/bench.mjs
benchmarks/internal/cluster-worker.cjs
benchmarks/internal/thread-worker.mjs
benchmarks/worker-selection/least.mjs
benchmarks/worker-selection/round-robin.mjs
examples/javascript/dynamicExample.cjs
examples/javascript/fixedExample.cjs
examples/javascript/multiFunctionExample.cjs
examples/javascript/multiFunctionWorker.cjs
examples/javascript/yourWorker.cjs
examples/typescript/http-client-pool/src/pool.ts
examples/typescript/http-client-pool/src/types.ts
examples/typescript/http-client-pool/src/worker.ts
examples/typescript/http-server-pool/express-cluster/rollup.config.ts
examples/typescript/http-server-pool/express-cluster/src/main.ts
examples/typescript/http-server-pool/express-cluster/src/worker.ts
examples/typescript/http-server-pool/express-hybrid/rollup.config.ts
examples/typescript/http-server-pool/express-hybrid/src/express-worker.ts
examples/typescript/http-server-pool/express-hybrid/src/main.ts
examples/typescript/http-server-pool/express-hybrid/src/request-handler-worker.ts
examples/typescript/http-server-pool/express-worker_threads/src/pool.ts
examples/typescript/http-server-pool/express-worker_threads/src/worker.ts
examples/typescript/http-server-pool/fastify-cluster/rollup.config.ts
examples/typescript/http-server-pool/fastify-cluster/src/main.ts
examples/typescript/http-server-pool/fastify-cluster/src/worker.ts
examples/typescript/http-server-pool/fastify-hybrid/rollup.config.ts
examples/typescript/http-server-pool/fastify-hybrid/src/fastify-poolifier.ts
examples/typescript/http-server-pool/fastify-hybrid/src/fastify-worker.ts
examples/typescript/http-server-pool/fastify-hybrid/src/main.ts
examples/typescript/http-server-pool/fastify-hybrid/src/request-handler-worker.ts
examples/typescript/http-server-pool/fastify-worker_threads/src/fastify-poolifier.ts
examples/typescript/http-server-pool/fastify-worker_threads/src/main.ts
examples/typescript/http-server-pool/fastify-worker_threads/src/worker.ts
examples/typescript/pool.ts
examples/typescript/smtp-client-pool/src/main.ts
examples/typescript/smtp-client-pool/src/pool.ts
examples/typescript/smtp-client-pool/src/worker.ts
examples/typescript/websocket-server-pool/ws-cluster/requests.js
examples/typescript/websocket-server-pool/ws-cluster/rollup.config.ts
examples/typescript/websocket-server-pool/ws-cluster/src/main.ts
examples/typescript/websocket-server-pool/ws-cluster/src/worker.ts
examples/typescript/websocket-server-pool/ws-hybrid/requests.js
examples/typescript/websocket-server-pool/ws-hybrid/rollup.config.ts
examples/typescript/websocket-server-pool/ws-hybrid/src/main.ts
examples/typescript/websocket-server-pool/ws-hybrid/src/request-handler-worker.ts
examples/typescript/websocket-server-pool/ws-hybrid/src/websocket-server-worker.ts
examples/typescript/websocket-server-pool/ws-worker_threads/requests.js
examples/typescript/websocket-server-pool/ws-worker_threads/src/main.ts
examples/typescript/websocket-server-pool/ws-worker_threads/src/pool.ts
examples/typescript/websocket-server-pool/ws-worker_threads/src/worker.ts
examples/typescript/worker.ts
package.json
pnpm-lock.yaml
rollup.config.mjs
src/circular-buffer.ts
src/fixed-priority-queue.ts
src/index.ts
src/pools/abstract-pool.ts
src/pools/cluster/dynamic.ts
src/pools/cluster/fixed.ts
src/pools/pool.ts
src/pools/selection-strategies/abstract-worker-choice-strategy.ts
src/pools/selection-strategies/fair-share-worker-choice-strategy.ts
src/pools/selection-strategies/interleaved-weighted-round-robin-worker-choice-strategy.ts
src/pools/selection-strategies/least-busy-worker-choice-strategy.ts
src/pools/selection-strategies/least-elu-worker-choice-strategy.ts
src/pools/selection-strategies/least-used-worker-choice-strategy.ts
src/pools/selection-strategies/round-robin-worker-choice-strategy.ts
src/pools/selection-strategies/selection-strategies-types.ts
src/pools/selection-strategies/selection-strategies-utils.ts
src/pools/selection-strategies/weighted-round-robin-worker-choice-strategy.ts
src/pools/selection-strategies/worker-choice-strategies-context.ts
src/pools/thread/dynamic.ts
src/pools/thread/fixed.ts
src/pools/utils.ts
src/pools/worker-node.ts
src/pools/worker.ts
src/priority-queue.ts
src/utility-types.ts
src/utils.ts
src/worker/abstract-worker.ts
src/worker/cluster-worker.ts
src/worker/task-functions.ts
src/worker/thread-worker.ts
src/worker/utils.ts
src/worker/worker-options.ts
tests/circular-buffer.test.mjs
tests/fixed-priority-queue.test.mjs
tests/pools/abstract-pool.test.mjs
tests/pools/cluster/dynamic.test.mjs
tests/pools/cluster/fixed.test.mjs
tests/pools/selection-strategies/selection-strategies-utils.test.mjs
tests/pools/selection-strategies/selection-strategies.test.mjs
tests/pools/selection-strategies/worker-choice-strategies-context.test.mjs
tests/pools/thread/dynamic.test.mjs
tests/pools/thread/fixed.test.mjs
tests/pools/utils.test.mjs
tests/pools/worker-node.test.mjs
tests/priority-queue.test.mjs
tests/test-types.cjs
tests/test-utils.cjs
tests/utils.test.mjs
tests/worker-files/cluster/asyncErrorWorker.cjs
tests/worker-files/cluster/asyncWorker.cjs
tests/worker-files/cluster/echoWorker.cjs
tests/worker-files/cluster/emptyWorker.cjs
tests/worker-files/cluster/errorWorker.cjs
tests/worker-files/cluster/longRunningWorkerHardBehavior.cjs
tests/worker-files/cluster/longRunningWorkerSoftBehavior.cjs
tests/worker-files/cluster/testMultipleTaskFunctionsWorker.cjs
tests/worker-files/cluster/testTaskFunctionObjectsWorker.cjs
tests/worker-files/cluster/testWorker.cjs
tests/worker-files/thread/asyncErrorWorker.mjs
tests/worker-files/thread/asyncWorker.mjs
tests/worker-files/thread/echoWorker.mjs
tests/worker-files/thread/emptyWorker.mjs
tests/worker-files/thread/errorWorker.mjs
tests/worker-files/thread/longRunningWorkerHardBehavior.mjs
tests/worker-files/thread/longRunningWorkerSoftBehavior.mjs
tests/worker-files/thread/testMultipleTaskFunctionsWorker.mjs
tests/worker-files/thread/testTaskFunctionObjectsWorker.mjs
tests/worker-files/thread/testWorker.mjs
tests/worker/abstract-worker.test.mjs
tests/worker/cluster-worker.test.mjs
tests/worker/thread-worker.test.mjs
tsdoc.json [deleted file]
typedoc.mjs

diff --git a/.eslintignore b/.eslintignore
deleted file mode 100644 (file)
index f2ad06f..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-docs/
-dist/
-lib/
-outputs/
diff --git a/.eslintrc.cjs b/.eslintrc.cjs
deleted file mode 100644 (file)
index a28991a..0000000
+++ /dev/null
@@ -1,189 +0,0 @@
-const { defineConfig } = require('eslint-define-config')
-
-module.exports = defineConfig({
-  root: true,
-  env: {
-    es2022: true,
-    node: true,
-    mocha: true
-  },
-  parserOptions: {
-    sourceType: 'module',
-    ecmaVersion: 2022
-  },
-  plugins: ['simple-import-sort', 'promise', 'spellcheck'],
-  extends: [
-    'eslint:recommended',
-    'plugin:import/recommended',
-    'plugin:promise/recommended'
-  ],
-  settings: {
-    'import/resolver': {
-      typescript: {
-        project: './tsconfig.json'
-      }
-    }
-  },
-  rules: {
-    'simple-import-sort/imports': 'error',
-    'simple-import-sort/exports': 'error',
-
-    'spellcheck/spell-checker': [
-      'warn',
-      {
-        skipWords: [
-          'argv',
-          'axios',
-          'benoit',
-          'bmf',
-          'browserslist',
-          'builtins',
-          'christopher',
-          'cjs',
-          'cloneable',
-          'comparator',
-          'cpu',
-          'cpus',
-          'cryptographically',
-          'ctx',
-          'decrement',
-          'deprecations',
-          'deque',
-          'dequeue',
-          'dequeued',
-          'deregisters',
-          'dts',
-          'ecma',
-          'elu',
-          'enqueue',
-          'enum',
-          'errored',
-          'esm',
-          'fastify',
-          'fibonacci',
-          'fp',
-          'fs',
-          'func',
-          'idx',
-          'inheritDoc',
-          'javascript',
-          'jsdoc',
-          'linebreak',
-          'localhost',
-          'microjob',
-          'mjs',
-          'nodemailer',
-          'npx',
-          'num',
-          'os',
-          'perf',
-          'piscina',
-          'pnpm',
-          'poolifier',
-          'prepend',
-          'prepends',
-          'positionals',
-          'readdir',
-          'readonly',
-          'req',
-          'resize',
-          'sinon',
-          'smtp',
-          'threadjs',
-          'threadwork',
-          'tinypool',
-          'tld',
-          'tos',
-          'tsconfig',
-          'tsdoc',
-          'typedoc',
-          'unlink',
-          'unref',
-          'utf8',
-          'workerpool',
-          'ws',
-          'wss',
-          'wwr'
-        ],
-        skipIfMatch: ['^@.*', '^plugin:.*']
-      }
-    ]
-  },
-  overrides: [
-    {
-      files: ['**/*.ts'],
-      plugins: ['@typescript-eslint', 'eslint-plugin-tsdoc'],
-      parser: '@typescript-eslint/parser',
-      parserOptions: {
-        project: './tsconfig.json'
-      },
-      extends: [
-        'plugin:@typescript-eslint/strict-type-checked',
-        'plugin:@typescript-eslint/stylistic-type-checked',
-        'plugin:import/typescript',
-        'love'
-      ],
-      rules: {
-        'operator-linebreak': 'off',
-        'tsdoc/syntax': 'warn'
-      }
-    },
-    {
-      files: ['examples/typescript/**/*.ts'],
-      rules: {
-        'import/no-unresolved': [
-          'error',
-          {
-            ignore: [
-              '^axios$',
-              '^express$',
-              '^fastify$',
-              '^fastify-plugin$',
-              '^node-fetch$',
-              '^nodemailer$',
-              '^poolifier$',
-              '^ws$'
-            ]
-          }
-        ],
-        '@typescript-eslint/no-unsafe-argument': 'off',
-        '@typescript-eslint/no-unsafe-call': 'off',
-        '@typescript-eslint/no-unsafe-return': 'off',
-        '@typescript-eslint/no-unsafe-assignment': 'off',
-        '@typescript-eslint/no-unsafe-member-access': 'off',
-        '@typescript-eslint/no-unnecessary-type-assertion': 'off',
-        '@typescript-eslint/no-redundant-type-constituents': 'off',
-        '@typescript-eslint/strict-boolean-expressions': 'off',
-        '@typescript-eslint/return-await': 'off',
-        '@typescript-eslint/no-non-null-assertion': 'off'
-      }
-    },
-    {
-      files: ['**/*.cjs', '**/*.js', '**/*.mjs'],
-      plugins: ['jsdoc'],
-      extends: ['plugin:n/recommended', 'plugin:jsdoc/recommended', 'standard']
-    },
-    {
-      files: ['tests/**/*.cjs', 'tests/**/*.js', 'tests/**/*.mjs'],
-      rules: {
-        'jsdoc/require-jsdoc': 'off'
-      }
-    },
-    {
-      files: [
-        'benchmarks/**/*.cjs',
-        'benchmarks/**/*.js',
-        'benchmarks/**/*.mjs'
-      ],
-      rules: {
-        'jsdoc/require-jsdoc': 'off'
-      }
-    },
-    {
-      files: ['examples/javascript/**/*.cjs', 'examples/javascript/**/*.js'],
-      rules: {
-        'jsdoc/require-jsdoc': 'off'
-      }
-    }
-  ]
-})
index aca15ab770f665c9fa9de2ff15cf036112cbde45..8cdf685f19b20acc912299aa08259b9050eccf86 100644 (file)
@@ -1,8 +1,8 @@
 export default {
   '**/*.{ts,tsx,js,jsx,cjs,mjs}': [
     'biome format --write',
-    'eslint --cache --fix'
+    'eslint --cache --fix',
   ],
   '**/*.json': ['biome format --write'],
-  '**/*.{md,yml,yaml}': ['prettier --cache --write']
+  '**/*.{md,yml,yaml}': ['prettier --cache --write'],
 }
index b014abdad4a6b7d9bdff169e9a2b2d9676f83d22..ebec4d23f67a2ada6ce297a94f948699520b52c7 100644 (file)
@@ -36,6 +36,7 @@
     "mochawesome",
     "MYBENCH",
     "nanothreads",
+    "neostandard",
     "npmjs",
     "nproc",
     "octocat",
@@ -58,6 +59,7 @@
     "tinypool",
     "trimmable",
     "tsdoc",
+    "tseslint",
     "typedoc",
     "workerpool"
   ],
index eaaf05d1be4df25ed55259d5878f26ff39c00bc1..f99a15017965dbd42dafc3ed025f1e51e9a48402 100644 (file)
@@ -2,7 +2,7 @@ const TaskFunctions = {
   jsonIntegerSerialization: 'jsonIntegerSerialization',
   fibonacci: 'fibonacci',
   factorial: 'factorial',
-  readWriteFiles: 'readWriteFiles'
+  readWriteFiles: 'readWriteFiles',
 }
 
 module.exports = { TaskFunctions }
index c3b470f7a152724e6729b1dc29ccb1bb58fa3761..f212c7b2eaa31e74629a42d86120bdbbf4e1e1a4 100644 (file)
@@ -4,14 +4,14 @@ const {
   mkdirSync,
   readFileSync,
   rmSync,
-  writeFileSync
+  writeFileSync,
 } = require('node:fs')
 const { TaskFunctions } = require('./benchmarks-types.cjs')
 
 const jsonIntegerSerialization = n => {
   for (let i = 0; i < n; i++) {
     const o = {
-      a: i
+      a: i,
     }
     JSON.stringify(o)
   }
@@ -19,8 +19,8 @@ const jsonIntegerSerialization = n => {
 }
 
 /**
- * @param {number} n - The number of fibonacci numbers to generate.
- * @returns {number} - The nth fibonacci number.
+ * @param n - The number of fibonacci numbers to generate.
+ * @returns - The nth fibonacci number.
  */
 const fibonacci = n => {
   n = BigInt(n)
@@ -36,8 +36,8 @@ const fibonacci = n => {
 }
 
 /**
- * @param {number} n - The number to calculate the factorial of.
- * @returns {number} - The factorial of n.
+ * @param n - The number to calculate the factorial of.
+ * @returns - The factorial of n.
  */
 const factorial = n => {
   if (n === 0 || n === 1) {
@@ -65,7 +65,7 @@ const readWriteFiles = (
     const filePath = `${baseDirectory}/${i}`
     writeFileSync(filePath, i.toString(), {
       encoding: 'utf8',
-      flag: 'a'
+      flag: 'a',
     })
     readFileSync(filePath, 'utf8')
   }
@@ -89,5 +89,5 @@ const executeTaskFunction = data => {
 }
 
 module.exports = {
-  executeTaskFunction
+  executeTaskFunction,
 }
index 16a656107fc6f00973fe7bdc6541a6bab2794a2b..6c01efcb348fa7ae11faf07131a3ea4d307cde0a 100644 (file)
@@ -10,7 +10,7 @@ import {
   Measurements,
   PoolTypes,
   WorkerChoiceStrategies,
-  WorkerTypes
+  WorkerTypes,
 } from '../lib/index.mjs'
 import { executeTaskFunction } from './benchmarks-utils.cjs'
 
@@ -80,13 +80,13 @@ export const runPoolifierBenchmarkTatamiNg = async (
                 async () => {
                   await runPoolifierPool(pool, {
                     taskExecutions,
-                    workerData
+                    workerData,
                   })
                 },
                 {
                   before: () => {
                     pool.setWorkerChoiceStrategy(workerChoiceStrategy, {
-                      measurement
+                      measurement,
                     })
                     pool.enableTasksQueue(enableTasksQueue)
                     strictEqual(
@@ -98,7 +98,7 @@ export const runPoolifierBenchmarkTatamiNg = async (
                       pool.opts.workerChoiceStrategyOptions.measurement,
                       measurement
                     )
-                  }
+                  },
                 }
               )
             })
@@ -112,7 +112,7 @@ export const runPoolifierBenchmarkTatamiNg = async (
               async () => {
                 await runPoolifierPool(pool, {
                   taskExecutions,
-                  workerData
+                  workerData,
                 })
               },
               {
@@ -124,7 +124,7 @@ export const runPoolifierBenchmarkTatamiNg = async (
                     workerChoiceStrategy
                   )
                   strictEqual(pool.opts.enableTasksQueue, enableTasksQueue)
-                }
+                },
               }
             )
           })
@@ -148,12 +148,12 @@ export const convertTatamiNgToBmf = report => {
           latency: {
             value: stats?.avg,
             lower_value: stats?.min,
-            upper_value: stats?.max
+            upper_value: stats?.max,
           },
           throughput: {
-            value: stats?.iter
-          }
-        }
+            value: stats?.iter,
+          },
+        },
       }
     })
     .reduce((obj, item) => Object.assign(obj, item), {})
index 3f467f9ea49689d642a4b9eae087416d806a9735..8bae6aaf7794ce3d181547a1401ca87455be2c02 100644 (file)
@@ -6,19 +6,19 @@ import { parseArgs } from 'node:util'
 import {
   availableParallelism,
   PoolTypes,
-  WorkerTypes
+  WorkerTypes,
 } from '../../lib/index.mjs'
 import { TaskFunctions } from '../benchmarks-types.cjs'
 import {
   convertTatamiNgToBmf,
-  runPoolifierBenchmarkTatamiNg
+  runPoolifierBenchmarkTatamiNg,
 } from '../benchmarks-utils.mjs'
 
 const poolSize = availableParallelism()
 const taskExecutions = 1
 const workerData = {
   function: TaskFunctions.factorial,
-  taskSize: 1000
+  taskSize: 1000,
 }
 const benchmarkReportFile = 'benchmark-report.json'
 let benchmarkReport
@@ -29,11 +29,11 @@ switch (
     options: {
       type: {
         type: 'string',
-        short: 't'
-      }
+        short: 't',
+      },
     },
     strict: true,
-    allowPositionals: true
+    allowPositionals: true,
   }).values.type
 ) {
   case 'tatami-ng':
@@ -46,7 +46,7 @@ switch (
         poolSize,
         {
           taskExecutions,
-          workerData
+          workerData,
         }
       )
     )
@@ -60,10 +60,10 @@ switch (
           poolSize,
           {
             taskExecutions,
-            workerData
+            workerData,
           }
         )
-      )
+      ),
     }
     benchmarkReport = {
       ...benchmarkReport,
@@ -75,10 +75,10 @@ switch (
           poolSize,
           {
             taskExecutions,
-            workerData
+            workerData,
           }
         )
-      )
+      ),
     }
     benchmarkReport = {
       ...benchmarkReport,
@@ -90,11 +90,12 @@ switch (
           poolSize,
           {
             taskExecutions,
-            workerData
+            workerData,
           }
         )
-      )
+      ),
     }
+    // eslint-disable-next-line @typescript-eslint/no-unused-expressions
     env.CI != null &&
       writeFileSync(benchmarkReportFile, JSON.stringify(benchmarkReport))
     break
index 5f59d49b8971cd4d692fe3e01a4599ba13a03d66..40d614c7364fe17feaa41bec8c3742842f450832 100644 (file)
@@ -8,6 +8,7 @@ const taskFunction = data => {
   data.function = data.function || TaskFunctions.factorial
   data.debug = data.debug || false
   const res = executeTaskFunction(data)
+  // eslint-disable-next-line @typescript-eslint/no-unused-expressions
   data.debug === true && console.debug(`This is the main thread ${isPrimary}`)
   return res
 }
index 232881b52e77dfbe1669f0d27fe62f059206a8a6..a5873926ffa587b16f345ab84e8cddd48564a3a7 100644 (file)
@@ -9,6 +9,7 @@ const taskFunction = data => {
   data.function = data.function || TaskFunctions.factorial
   data.debug = data.debug || false
   const res = executeTaskFunction(data)
+  // eslint-disable-next-line @typescript-eslint/no-unused-expressions
   data.debug === true &&
     console.debug(`This is the main thread ${isMainThread}`)
   return res
index 4be3826f7e8165bb698e9c9dd21617b8b0f26160..5c9ff1ba6f7698d345c71b9e67a0ab1ad9ee47e2 100644 (file)
@@ -2,6 +2,11 @@ import { randomInt } from 'node:crypto'
 
 import { bench, group, run } from 'tatami-ng'
 
+/**
+ *
+ * @param numberOfWorkers
+ * @param maxNumberOfTasksPerWorker
+ */
 function generateRandomTasksMap (
   numberOfWorkers,
   maxNumberOfTasksPerWorker = 10
@@ -16,6 +21,10 @@ function generateRandomTasksMap (
 
 const tasksMap = generateRandomTasksMap(60, 20)
 
+/**
+ *
+ * @param tasksMap
+ */
 function loopSelect (tasksMap) {
   let minKey
   let minValue = Number.POSITIVE_INFINITY
@@ -30,6 +39,10 @@ function loopSelect (tasksMap) {
   return [minKey, minValue]
 }
 
+/**
+ *
+ * @param tasksMap
+ */
 function arraySortSelect (tasksMap) {
   const tasksArray = Array.from(tasksMap)
   return tasksArray.sort((a, b) => {
@@ -54,12 +67,26 @@ const randomPivotIndexSelect = (leftIndex, rightIndex) => {
   return randomInt(leftIndex, rightIndex)
 }
 
+/**
+ *
+ * @param array
+ * @param index1
+ * @param index2
+ */
 function swap (array, index1, index2) {
   const tmp = array[index1]
   array[index1] = array[index2]
   array[index2] = tmp
 }
 
+/**
+ *
+ * @param array
+ * @param leftIndex
+ * @param rightIndex
+ * @param pivotIndex
+ * @param compare
+ */
 function partition (
   array,
   leftIndex,
@@ -80,6 +107,15 @@ function partition (
   return storeIndex
 }
 
+/**
+ *
+ * @param array
+ * @param k
+ * @param leftIndex
+ * @param rightIndex
+ * @param compare
+ * @param pivotIndexSelect
+ */
 function selectLoop (
   array,
   k,
@@ -102,6 +138,15 @@ function selectLoop (
   }
 }
 
+/**
+ *
+ * @param array
+ * @param k
+ * @param leftIndex
+ * @param rightIndex
+ * @param compare
+ * @param pivotIndexSelect
+ */
 function selectRecursion (
   array,
   k,
@@ -122,6 +167,10 @@ function selectRecursion (
   }
 }
 
+/**
+ *
+ * @param tasksMap
+ */
 function quickSelectLoop (tasksMap) {
   const tasksArray = Array.from(tasksMap)
 
@@ -130,6 +179,10 @@ function quickSelectLoop (tasksMap) {
   })
 }
 
+/**
+ *
+ * @param tasksMap
+ */
 function quickSelectLoopRandomPivot (tasksMap) {
   const tasksArray = Array.from(tasksMap)
 
@@ -145,6 +198,10 @@ function quickSelectLoopRandomPivot (tasksMap) {
   )
 }
 
+/**
+ *
+ * @param tasksMap
+ */
 function quickSelectRecursion (tasksMap) {
   const tasksArray = Array.from(tasksMap)
 
@@ -153,6 +210,10 @@ function quickSelectRecursion (tasksMap) {
   })
 }
 
+/**
+ *
+ * @param tasksMap
+ */
 function quickSelectRecursionRandomPivot (tasksMap) {
   const tasksArray = Array.from(tasksMap)
 
index 828924503c8890d597d43bdd44692fa2c3c0d16a..d39fd699f58016e69052f52dbcf87e6945c5f07b 100644 (file)
@@ -1,5 +1,9 @@
 import { bench, group, run } from 'tatami-ng'
 
+/**
+ *
+ * @param numberOfWorkers
+ */
 function generateWorkersArray (numberOfWorkers) {
   return [...Array(numberOfWorkers).keys()]
 }
@@ -8,12 +12,18 @@ const workers = generateWorkersArray(60)
 
 let nextWorkerIndex
 
+/**
+ *
+ */
 function roundRobinTernaryOffByOne () {
   nextWorkerIndex =
     workers.length - 1 === nextWorkerIndex ? 0 : nextWorkerIndex + 1
   return workers[nextWorkerIndex]
 }
 
+/**
+ *
+ */
 function roundRobinTernaryWithNegation () {
   nextWorkerIndex =
     !nextWorkerIndex || workers.length - 1 === nextWorkerIndex
@@ -22,6 +32,9 @@ function roundRobinTernaryWithNegation () {
   return workers[nextWorkerIndex]
 }
 
+/**
+ *
+ */
 function roundRobinTernaryWithPreChoosing () {
   const chosenWorker = workers[nextWorkerIndex]
   nextWorkerIndex =
@@ -29,6 +42,9 @@ function roundRobinTernaryWithPreChoosing () {
   return chosenWorker
 }
 
+/**
+ *
+ */
 function roundRobinIncrementModulo () {
   const chosenWorker = workers[nextWorkerIndex]
   nextWorkerIndex++
index a72ce3a6a6cd07e587686ce25c4c0083ce334aa8..ac361d08fd7e1913937ba84bd122f403da86bc0b 100644 (file)
@@ -2,7 +2,7 @@
 const {
   DynamicThreadPool,
   PoolEvents,
-  availableParallelism
+  availableParallelism,
 } = require('poolifier')
 
 const pool = new DynamicThreadPool(
@@ -11,7 +11,7 @@ const pool = new DynamicThreadPool(
   './yourWorker.js',
   {
     onlineHandler: () => console.info('worker is online'),
-    errorHandler: e => console.error(e)
+    errorHandler: e => console.error(e),
   }
 )
 let poolFull = 0
index f191aa24d7d25e07e8bd3b9ff8eff0e02442482c..ac2c3bee4b3cfae4ef389a71093bf1850f1c4acc 100644 (file)
@@ -2,12 +2,12 @@
 const {
   FixedThreadPool,
   PoolEvents,
-  availableParallelism
+  availableParallelism,
 } = require('poolifier')
 
 const pool = new FixedThreadPool(availableParallelism(), './yourWorker.cjs', {
   onlineHandler: () => console.info('worker is online'),
-  errorHandler: e => console.error(e)
+  errorHandler: e => console.error(e),
 })
 let poolReady = 0
 let poolBusy = 0
index 643d117a2b8bcdeeaec5be9a61fe7272ce773dd7..9f92c132c55b4b8dc7824b49043bc26959f3f9a2 100644 (file)
@@ -6,7 +6,7 @@ const pool = new FixedThreadPool(
   './multiFunctionWorker.cjs',
   {
     onlineHandler: () => console.info('worker is online'),
-    errorHandler: e => console.error(e)
+    errorHandler: e => console.error(e),
   }
 )
 
index da8f972ffa7d3cf68f4e7d059b7356a69080b90e..d49962d621db95e015d72a7472a6b87c9b2ea159 100644 (file)
@@ -1,11 +1,19 @@
 'use strict'
 const { ThreadWorker } = require('poolifier')
 
+/**
+ *
+ * @param data
+ */
 function fn0 (data) {
   console.info('Executing fn0')
   return { data: `fn0 input text was '${data.text}'` }
 }
 
+/**
+ *
+ * @param data
+ */
 function fn1 (data) {
   console.info('Executing fn1')
   return { data: `fn1 input text was '${data.text}'` }
index 073253ea2300d9d7277cec9c77b34a8a8d1a1e40..fce399bd3f986caec0dcff464c1ee2e71fe5eb4b 100644 (file)
@@ -1,10 +1,13 @@
 'use strict'
 const { ThreadWorker } = require('poolifier')
 
+/**
+ *
+ */
 function yourFunction () {
   for (let i = 0; i <= 1000; i++) {
     const o = {
-      a: i
+      a: i,
     }
     JSON.stringify(o)
   }
index 6988372eb1e4e07683fd129f8a2ea2b9ea0d40e2..83bec2fd5ac1dc501a4c6b8cc68ca56721d170c5 100644 (file)
@@ -17,10 +17,10 @@ export const httpClientPool = new DynamicThreadPool<WorkerData, WorkerResponse>(
   {
     enableTasksQueue: true,
     tasksQueueOptions: {
-      concurrency: 8
+      concurrency: 8,
     },
     errorHandler: (e: Error) => {
       console.error('Thread worker error:', e)
-    }
+    },
   }
 )
index 9b35949c970daf7a885bdd99c600f9814ab4bdfc..d21087dd0d24b7eb0b79e2c99d507239f3ddd474 100644 (file)
@@ -3,7 +3,7 @@ import type { URL } from 'node:url'
 import type { AxiosRequestConfig } from 'axios'
 import type {
   RequestInfo as NodeFetchRequestInfo,
-  RequestInit as NodeFetchRequestInit
+  RequestInit as NodeFetchRequestInit,
 } from 'node-fetch'
 
 export interface WorkerData {
index 904279b48ed940b17f1ffbb7c4b1743ade65457e..95917d64207d4d846353be93b6560b9ff6b21e9d 100644 (file)
@@ -1,7 +1,7 @@
 import axios from 'axios'
 import nodeFetch, {
   type RequestInfo as NodeFetchRequestInfo,
-  type ResponseInit as NodeFetchRequestInit
+  type ResponseInit as NodeFetchRequestInit,
 } from 'node-fetch'
 import { ThreadWorker } from 'poolifier'
 
@@ -12,34 +12,37 @@ class HttpClientWorker extends ThreadWorker<WorkerData, WorkerResponse> {
     super({
       node_fetch: async (workerData?: WorkerData) => {
         const response = await nodeFetch(
+          // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
           workerData!.input as URL | NodeFetchRequestInfo,
           workerData?.init as NodeFetchRequestInit
         )
         // The response is not structured-cloneable, so we return the response text body instead.
         return {
-          text: await response.text()
+          text: await response.text(),
         }
       },
       fetch: async (workerData?: WorkerData) => {
         const response = await fetch(
+          // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
           workerData!.input as URL | RequestInfo,
           workerData?.init as RequestInit
         )
         // The response is not structured-cloneable, so we return the response text body instead.
         return {
-          text: await response.text()
+          text: await response.text(),
         }
       },
       axios: async (workerData?: WorkerData) => {
         const response = await axios({
           method: 'get',
+          // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
           url: workerData!.input as string,
-          ...workerData?.axiosRequestConfig
+          ...workerData?.axiosRequestConfig,
         })
         return {
-          text: response.data
+          text: response.data,
         }
-      }
+      },
     })
   }
 }
index 236d018c1fe62fc8d35426874f4a21e4b68c13f6..2fd3760732d9afd8edf71a3712e6e8b79d771300 100644 (file)
@@ -11,19 +11,19 @@ export default defineConfig({
       dir: './dist',
       sourcemap: true,
       entryFileNames: '[name].cjs',
-      chunkFileNames: '[name]-[hash].cjs'
+      chunkFileNames: '[name]-[hash].cjs',
     },
     {
       format: 'esm',
       dir: './dist',
-      sourcemap: true
-    }
+      sourcemap: true,
+    },
   ],
   external: ['express', /^node:*/, 'poolifier'],
   plugins: [
     typescript(),
     del({
-      targets: ['./dist/*']
-    })
-  ]
+      targets: ['./dist/*'],
+    }),
+  ],
 })
index 8922c9fdf5075ed8fc3a5aa54868853a9b740549..eeb196a623a9c939a1f38bbabd157a581a5b7f5d 100644 (file)
@@ -32,6 +32,6 @@ const pool = new FixedClusterPool<WorkerData, WorkerResponse>(
     },
     errorHandler: (e: Error) => {
       console.error('Cluster worker error:', e)
-    }
+    },
   }
 )
index 4659e00aee4acb7a91ada465a294fa4fafc7b5db..af25b056351d2d2eedd0a9798f04e65399a27410 100644 (file)
@@ -25,6 +25,7 @@ class ExpressWorker extends ClusterWorker<WorkerData, WorkerResponse> {
   private static readonly startExpress = (
     workerData?: WorkerData
   ): WorkerResponse => {
+    // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
     const { port } = workerData!
 
     const application: Express = express()
@@ -40,7 +41,7 @@ class ExpressWorker extends ClusterWorker<WorkerData, WorkerResponse> {
       const { number } = req.params
       res
         .send({
-          number: ExpressWorker.factorial(Number.parseInt(number)).toString()
+          number: ExpressWorker.factorial(Number.parseInt(number)).toString(),
         })
         .end()
     })
@@ -54,7 +55,7 @@ class ExpressWorker extends ClusterWorker<WorkerData, WorkerResponse> {
     })
     return {
       status: true,
-      port: listenerPort ?? port
+      port: listenerPort ?? port,
     }
   }
 
@@ -62,7 +63,7 @@ class ExpressWorker extends ClusterWorker<WorkerData, WorkerResponse> {
     super(ExpressWorker.startExpress, {
       killHandler: () => {
         ExpressWorker.server.close()
-      }
+      },
     })
   }
 }
index 9c29f0049816e6214f09b8d1ea3a112bf52175f8..cd2a4a98179e0f9e93218440cc39cd44c4ae11db 100644 (file)
@@ -6,7 +6,7 @@ export default defineConfig({
   input: [
     './src/main.ts',
     './src/express-worker.ts',
-    './src/request-handler-worker.ts'
+    './src/request-handler-worker.ts',
   ],
   strictDeprecations: true,
   output: [
@@ -15,19 +15,19 @@ export default defineConfig({
       dir: './dist',
       sourcemap: true,
       entryFileNames: '[name].cjs',
-      chunkFileNames: '[name]-[hash].cjs'
+      chunkFileNames: '[name]-[hash].cjs',
     },
     {
       format: 'esm',
       dir: './dist',
-      sourcemap: true
-    }
+      sourcemap: true,
+    },
   ],
   external: ['express', /^node:*/, 'poolifier'],
   plugins: [
     typescript(),
     del({
-      targets: ['./dist/*']
-    })
-  ]
+      targets: ['./dist/*'],
+    }),
+  ],
 })
index bde3ad4e629c97941870c97c894e7442195fc3c0..360cf9137cdc2af41c059d6b9ef789788a02c74a 100644 (file)
@@ -5,7 +5,7 @@ import express, { type Express, type Request, type Response } from 'express'
 import {
   availableParallelism,
   ClusterWorker,
-  DynamicThreadPool
+  DynamicThreadPool,
 } from 'poolifier'
 
 import type {
@@ -13,7 +13,7 @@ import type {
   ClusterWorkerResponse,
   DataPayload,
   ThreadWorkerData,
-  ThreadWorkerResponse
+  ThreadWorkerResponse,
 } from './types.js'
 
 const emptyFunction = (): void => {
@@ -21,24 +21,25 @@ const emptyFunction = (): void => {
 }
 
 class ExpressWorker extends ClusterWorker<
-ClusterWorkerData,
-ClusterWorkerResponse
+  ClusterWorkerData,
+  ClusterWorkerResponse
 > {
   private static server: Server
   private static requestHandlerPool: DynamicThreadPool<
-  ThreadWorkerData<DataPayload>,
-  ThreadWorkerResponse<DataPayload>
+    ThreadWorkerData<DataPayload>,
+    ThreadWorkerResponse<DataPayload>
   >
 
   private static readonly startExpress = (
     workerData?: ClusterWorkerData
   ): ClusterWorkerResponse => {
     const { port, workerFile, minWorkers, maxWorkers, ...poolOptions } =
+      // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
       workerData!
 
     ExpressWorker.requestHandlerPool = new DynamicThreadPool<
-    ThreadWorkerData<DataPayload>,
-    ThreadWorkerResponse<DataPayload>
+      ThreadWorkerData<DataPayload>,
+      ThreadWorkerResponse<DataPayload>
     >(
       minWorkers ?? 1,
       maxWorkers ?? availableParallelism(),
@@ -79,7 +80,7 @@ ClusterWorkerResponse
     })
     return {
       status: true,
-      port: listenerPort ?? port
+      port: listenerPort ?? port,
     }
   }
 
@@ -88,7 +89,7 @@ ClusterWorkerResponse
       killHandler: async () => {
         await ExpressWorker.requestHandlerPool.destroy()
         ExpressWorker.server.close()
-      }
+      },
     })
   }
 }
index 69a329b6a9b3613b6da047af2786698f7e1134aa..1406248fbcc7b98891d6ec49c62f6af69528836d 100644 (file)
@@ -31,11 +31,11 @@ const pool = new FixedClusterPool<ClusterWorkerData, ClusterWorkerResponse>(
           workerFile: requestHandlerWorkerFile,
           enableTasksQueue: true,
           tasksQueueOptions: {
-            concurrency: 8
+            concurrency: 8,
           },
           errorHandler: (e: Error) => {
             console.error('Thread worker error:', e)
-          }
+          },
         })
         .then(response => {
           if (response.status) {
@@ -51,6 +51,6 @@ const pool = new FixedClusterPool<ClusterWorkerData, ClusterWorkerResponse>(
     },
     errorHandler: (e: Error) => {
       console.error('Cluster worker error:', e)
-    }
+    },
   }
 )
index 5dbc11375668513fdf1d1ce9f7a28607202398ac..5297de12846601c580c09773eee7e8bee34163c3 100644 (file)
@@ -3,7 +3,7 @@ import { ThreadWorker } from 'poolifier'
 import type {
   DataPayload,
   ThreadWorkerData,
-  ThreadWorkerResponse
+  ThreadWorkerResponse,
 } from './types.js'
 
 class RequestHandlerWorker<
@@ -32,16 +32,17 @@ class RequestHandlerWorker<
         return {
           data: {
             number: RequestHandlerWorker.factorial(
+              // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
               workerData!.data.number!
-            ).toString()
-          }
+            ).toString(),
+          },
         } as unknown as Response
-      }
+      },
     })
   }
 }
 
 export const requestHandlerWorker = new RequestHandlerWorker<
-ThreadWorkerData<DataPayload>,
-ThreadWorkerResponse<DataPayload>
+  ThreadWorkerData<DataPayload>,
+  ThreadWorkerResponse<DataPayload>
 >()
index 0f6a7accb63ce881e49a3a06b34647297fd6a064..29bf4ef7a2be91fbd584429242f5321e722064ba 100644 (file)
@@ -11,14 +11,14 @@ const workerFile = join(
 )
 
 export const requestHandlerPool = new DynamicThreadPool<
-WorkerData<BodyPayload>,
-WorkerResponse<BodyPayload>
+  WorkerData<BodyPayload>,
+  WorkerResponse<BodyPayload>
 >(1, availableParallelism(), workerFile, {
   enableTasksQueue: true,
   tasksQueueOptions: {
-    concurrency: 8
+    concurrency: 8,
   },
   errorHandler: (e: Error) => {
     console.error('Thread worker error:', e)
-  }
+  },
 })
index 09810907704576fedd1e337afb09b59560246551..c5819f83870432f12f8b9f88b1e1d7d66e6ff452 100644 (file)
@@ -28,16 +28,17 @@ class RequestHandlerWorker<
         return {
           body: {
             number: RequestHandlerWorker.factorial(
+              // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
               workerData!.body.number!
-            ).toString()
-          }
+            ).toString(),
+          },
         } as unknown as Response
-      }
+      },
     })
   }
 }
 
 export const requestHandlerWorker = new RequestHandlerWorker<
-WorkerData<BodyPayload>,
-WorkerResponse<BodyPayload>
+  WorkerData<BodyPayload>,
+  WorkerResponse<BodyPayload>
 >()
index 5e0a32d4d5929abcba7148da4c01916f21b70182..03cbd852fd0daf715346ea35f8aa4f792fe77ba5 100644 (file)
@@ -11,19 +11,19 @@ export default defineConfig({
       dir: './dist',
       sourcemap: true,
       entryFileNames: '[name].cjs',
-      chunkFileNames: '[name]-[hash].cjs'
+      chunkFileNames: '[name]-[hash].cjs',
     },
     {
       format: 'esm',
       dir: './dist',
-      sourcemap: true
-    }
+      sourcemap: true,
+    },
   ],
   external: ['fastify', /^node:*/, 'poolifier'],
   plugins: [
     typescript(),
     del({
-      targets: ['./dist/*']
-    })
-  ]
+      targets: ['./dist/*'],
+    }),
+  ],
 })
index 541f00178bb00bff56bb1bc515268279938f8c1a..794a93b6bfed3b3288c57238390a8eb60e422ff8 100644 (file)
@@ -32,6 +32,6 @@ const pool = new FixedClusterPool<WorkerData, WorkerResponse>(
     },
     errorHandler: (e: Error) => {
       console.error('Cluster worker error:', e)
-    }
+    },
   }
 )
index e491fa8f4b05c3ee4712740e1e669a102775108e..7003e265492b4e9d0c8d9974978e8c996bf7a0d6 100644 (file)
@@ -24,10 +24,11 @@ class FastifyWorker extends ClusterWorker<WorkerData, WorkerResponse> {
   private static readonly startFastify = async (
     workerData?: WorkerData
   ): Promise<WorkerResponse> => {
+    // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
     const { port } = workerData!
 
     FastifyWorker.fastify = Fastify({
-      logger: true
+      logger: true,
     })
 
     FastifyWorker.fastify.all('/api/echo', request => {
@@ -44,7 +45,7 @@ class FastifyWorker extends ClusterWorker<WorkerData, WorkerResponse> {
     await FastifyWorker.fastify.listen({ port })
     return {
       status: true,
-      port: (FastifyWorker.fastify.server.address() as AddressInfo).port
+      port: (FastifyWorker.fastify.server.address() as AddressInfo).port,
     }
   }
 
@@ -52,7 +53,7 @@ class FastifyWorker extends ClusterWorker<WorkerData, WorkerResponse> {
     super(FastifyWorker.startFastify, {
       killHandler: async () => {
         await FastifyWorker.fastify.close()
-      }
+      },
     })
   }
 }
index 6bb949aa6a7bcab8e3e54d8a47a60950996b9a30..ae79b9bcf0e0b04525c6ee13ce14ff0728bfc454 100644 (file)
@@ -6,7 +6,7 @@ export default defineConfig({
   input: [
     './src/main.ts',
     './src/fastify-worker.ts',
-    './src/request-handler-worker.ts'
+    './src/request-handler-worker.ts',
   ],
   strictDeprecations: true,
   output: [
@@ -15,19 +15,19 @@ export default defineConfig({
       dir: './dist',
       sourcemap: true,
       entryFileNames: '[name].cjs',
-      chunkFileNames: '[name]-[hash].cjs'
+      chunkFileNames: '[name]-[hash].cjs',
     },
     {
       format: 'esm',
       dir: './dist',
-      sourcemap: true
-    }
+      sourcemap: true,
+    },
   ],
   external: ['fastify', 'fastify-plugin', /^node:*/, 'poolifier'],
   plugins: [
     typescript(),
     del({
-      targets: ['./dist/*']
-    })
-  ]
+      targets: ['./dist/*'],
+    }),
+  ],
 })
index b4369082833e5409823401a9c61608765d97138a..753f6df1872f39d879800d600780e6d598511cd6 100644 (file)
@@ -7,7 +7,7 @@ import { availableParallelism, DynamicThreadPool } from 'poolifier'
 import type {
   FastifyPoolifierOptions,
   ThreadWorkerData,
-  ThreadWorkerResponse
+  ThreadWorkerResponse,
 } from './types.js'
 
 const fastifyPoolifierPlugin: FastifyPluginCallback<FastifyPoolifierOptions> = (
@@ -18,13 +18,15 @@ const fastifyPoolifierPlugin: FastifyPluginCallback<FastifyPoolifierOptions> = (
   options = {
     ...{
       minWorkers: 1,
-      maxWorkers: availableParallelism()
+      maxWorkers: availableParallelism(),
     },
-    ...options
+    ...options,
   }
   const { workerFile, minWorkers, maxWorkers, ...poolOptions } = options
   const pool = new DynamicThreadPool<ThreadWorkerData, ThreadWorkerResponse>(
+    // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
     minWorkers!,
+    // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
     maxWorkers!,
     workerFile,
     poolOptions
@@ -48,5 +50,5 @@ const fastifyPoolifierPlugin: FastifyPluginCallback<FastifyPoolifierOptions> = (
 
 export const fastifyPoolifier = fp(fastifyPoolifierPlugin, {
   fastify: '4.x',
-  name: 'fastify-poolifier'
+  name: 'fastify-poolifier',
 })
index 8e4713cfae2df7e3a158c6191a3ec57fc3d8060f..4a697f3e255def59329478440f5f8d7ca205737e 100644 (file)
@@ -7,18 +7,19 @@ import { fastifyPoolifier } from './fastify-poolifier.js'
 import type { ClusterWorkerData, ClusterWorkerResponse } from './types.js'
 
 class FastifyWorker extends ClusterWorker<
-ClusterWorkerData,
-ClusterWorkerResponse
+  ClusterWorkerData,
+  ClusterWorkerResponse
 > {
   private static fastify: FastifyInstance
 
   private static readonly startFastify = async (
     workerData?: ClusterWorkerData
   ): Promise<ClusterWorkerResponse> => {
+    // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
     const { port, ...fastifyPoolifierOptions } = workerData!
 
     FastifyWorker.fastify = Fastify({
-      logger: true
+      logger: true,
     })
 
     await FastifyWorker.fastify.register(
@@ -44,7 +45,7 @@ ClusterWorkerResponse
     await FastifyWorker.fastify.listen({ port })
     return {
       status: true,
-      port: (FastifyWorker.fastify.server.address() as AddressInfo).port
+      port: (FastifyWorker.fastify.server.address() as AddressInfo).port,
     }
   }
 
@@ -53,7 +54,7 @@ ClusterWorkerResponse
       killHandler: async () => {
         await FastifyWorker.fastify.pool.destroy()
         await FastifyWorker.fastify.close()
-      }
+      },
     })
   }
 }
index fea592c4b180291e68c50b8844ae0f6e3d1eb290..4622324c02c97f1e141abccb7c7b464ed113508d 100644 (file)
@@ -31,11 +31,11 @@ const pool = new FixedClusterPool<ClusterWorkerData, ClusterWorkerResponse>(
               : Math.round(availableParallelism() / 4),
           enableTasksQueue: true,
           tasksQueueOptions: {
-            concurrency: 8
+            concurrency: 8,
           },
           errorHandler: (e: Error) => {
             console.error('Thread worker error', e)
-          }
+          },
         })
         .then(response => {
           if (response.status) {
@@ -51,6 +51,6 @@ const pool = new FixedClusterPool<ClusterWorkerData, ClusterWorkerResponse>(
     },
     errorHandler: (e: Error) => {
       console.error('Cluster worker error:', e)
-    }
+    },
   }
 )
index 5dbc11375668513fdf1d1ce9f7a28607202398ac..5297de12846601c580c09773eee7e8bee34163c3 100644 (file)
@@ -3,7 +3,7 @@ import { ThreadWorker } from 'poolifier'
 import type {
   DataPayload,
   ThreadWorkerData,
-  ThreadWorkerResponse
+  ThreadWorkerResponse,
 } from './types.js'
 
 class RequestHandlerWorker<
@@ -32,16 +32,17 @@ class RequestHandlerWorker<
         return {
           data: {
             number: RequestHandlerWorker.factorial(
+              // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
               workerData!.data.number!
-            ).toString()
-          }
+            ).toString(),
+          },
         } as unknown as Response
-      }
+      },
     })
   }
 }
 
 export const requestHandlerWorker = new RequestHandlerWorker<
-ThreadWorkerData<DataPayload>,
-ThreadWorkerResponse<DataPayload>
+  ThreadWorkerData<DataPayload>,
+  ThreadWorkerResponse<DataPayload>
 >()
index c031d287d34a640b368839fe8ef6936d47a6cf9a..451fcb80b3e12ad89c9022d8b604245adae9f1c1 100644 (file)
@@ -7,7 +7,7 @@ import { availableParallelism, DynamicThreadPool } from 'poolifier'
 import type {
   FastifyPoolifierOptions,
   WorkerData,
-  WorkerResponse
+  WorkerResponse,
 } from './types.js'
 
 const fastifyPoolifierPlugin: FastifyPluginCallback<FastifyPoolifierOptions> = (
@@ -18,13 +18,15 @@ const fastifyPoolifierPlugin: FastifyPluginCallback<FastifyPoolifierOptions> = (
   options = {
     ...{
       minWorkers: 1,
-      maxWorkers: availableParallelism()
+      maxWorkers: availableParallelism(),
     },
-    ...options
+    ...options,
   }
   const { workerFile, minWorkers, maxWorkers, ...poolOptions } = options
   const pool = new DynamicThreadPool<WorkerData, WorkerResponse>(
+    // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
     minWorkers!,
+    // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
     maxWorkers!,
     workerFile,
     poolOptions
@@ -47,5 +49,5 @@ const fastifyPoolifierPlugin: FastifyPluginCallback<FastifyPoolifierOptions> = (
 
 export const fastifyPoolifier = fp(fastifyPoolifierPlugin, {
   fastify: '4.x',
-  name: 'fastify-poolifier'
+  name: 'fastify-poolifier',
 })
index 5610bc1d48bbadf0edee7b87b710d9feb5066d48..d30e913cb8b7ca47cb6f8993cefc28ee6a177803 100644 (file)
@@ -12,7 +12,7 @@ import { fastifyPoolifier } from './fastify-poolifier.js'
 
 const port = 8080
 const fastify = Fastify({
-  logger: true
+  logger: true,
 })
 
 const workerFile = join(
@@ -24,11 +24,11 @@ await fastify.register(fastifyPoolifier, {
   workerFile,
   enableTasksQueue: true,
   tasksQueueOptions: {
-    concurrency: 8
+    concurrency: 8,
   },
   errorHandler: (e: Error) => {
     fastify.log.error('Thread worker error:', e)
-  }
+  },
 })
 
 fastify.all('/api/echo', async request => {
index 09810907704576fedd1e337afb09b59560246551..c5819f83870432f12f8b9f88b1e1d7d66e6ff452 100644 (file)
@@ -28,16 +28,17 @@ class RequestHandlerWorker<
         return {
           body: {
             number: RequestHandlerWorker.factorial(
+              // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
               workerData!.body.number!
-            ).toString()
-          }
+            ).toString(),
+          },
         } as unknown as Response
-      }
+      },
     })
   }
 }
 
 export const requestHandlerWorker = new RequestHandlerWorker<
-WorkerData<BodyPayload>,
-WorkerResponse<BodyPayload>
+  WorkerData<BodyPayload>,
+  WorkerResponse<BodyPayload>
 >()
index 3965e1f0a1cd4c8e2632b59018972e79fa5b798e..5d3d8e756833d84775d24bde59a975792da5b94b 100644 (file)
@@ -4,7 +4,7 @@ import { fileURLToPath } from 'node:url'
 import {
   availableParallelism,
   DynamicThreadPool,
-  FixedThreadPool
+  FixedThreadPool,
 } from 'poolifier'
 
 import type { MyData, MyResponse } from './worker.js'
@@ -23,7 +23,7 @@ const fixedPool = new FixedThreadPool<MyData, MyResponse>(
     },
     errorHandler: (e: Error) => {
       console.error(e)
-    }
+    },
   }
 )
 
@@ -39,13 +39,12 @@ const dynamicPool = new DynamicThreadPool<MyData, MyResponse>(
     },
     errorHandler: (e: Error) => {
       console.error(e)
-    }
+    },
   }
 )
 
 await dynamicPool.execute()
 
-// eslint-disable-next-line @typescript-eslint/no-misused-promises
 setTimeout(async () => {
   await fixedPool.destroy()
   await dynamicPool.destroy()
index 620bdb94e3ba65b193d1b3dfb125ed1d62320820..e00372dc6f931ab5a4dea915728a9dd0c14754f6 100644 (file)
@@ -14,16 +14,16 @@ for (const to of tos) {
         secure: true,
         auth: {
           user: 'REPLACE-WITH-YOUR-ALIAS@DOMAIN.TLD',
-          pass: 'REPLACE-WITH-YOUR-GENERATED-PASSWORD'
-        }
+          pass: 'REPLACE-WITH-YOUR-GENERATED-PASSWORD',
+        },
       },
       mail: {
         from: '"Foo" <foo@domain.tld>',
         to,
         subject: 'Hello',
         text: 'Hello world?',
-        html: '<b>Hello world?</b>'
-      }
+        html: '<b>Hello world?</b>',
+      },
     })
   )
 }
index 315bf4eab77274267d4f7928973b9d8733e5ec28..747837037499e5665e0f6482cc7f4946be08882a 100644 (file)
@@ -12,14 +12,14 @@ const workerFile = join(
 )
 
 export const smtpClientPool = new DynamicThreadPool<
-WorkerData,
-SMTPTransport.SentMessageInfo
+  WorkerData,
+  SMTPTransport.SentMessageInfo
 >(0, availableParallelism(), workerFile, {
   enableTasksQueue: true,
   tasksQueueOptions: {
-    concurrency: 8
+    concurrency: 8,
   },
   errorHandler: (e: Error) => {
     console.error('Thread worker error:', e)
-  }
+  },
 })
index 622886351e71d9e2d234548fc2009ad3639d6aa4..e2667b326f08fc718f93e9b9f43d881c1878a1ed 100644 (file)
@@ -5,16 +5,17 @@ import { ThreadWorker } from 'poolifier'
 import type { WorkerData } from './types.js'
 
 class SmtpClientWorker extends ThreadWorker<
-WorkerData,
-SMTPTransport.SentMessageInfo
+  WorkerData,
+  SMTPTransport.SentMessageInfo
 > {
   public constructor () {
     super({
       nodemailer: async (workerData?: WorkerData) => {
         return await createTransport(workerData?.smtpTransport).sendMail(
+          // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
           workerData!.mail
         )
-      }
+      },
     })
   }
 }
index 9beb2b7828b077eb5fc00c5ce810b3dd7b148d82..2c73376f6ee4089920e10a12c52560062ef3c2c1 100644 (file)
@@ -1,4 +1,3 @@
-// eslint-disable-next-line import/no-unresolved, n/no-missing-import
 import { WebSocket } from 'ws'
 
 const ws = new WebSocket('ws://localhost:8080')
index a4f7212624a233822cf95fa1f15788faefe8c29e..4080e1ac74c72bad30d95862cfba92c5bef8be7b 100644 (file)
@@ -11,19 +11,19 @@ export default defineConfig({
       dir: './dist',
       sourcemap: true,
       entryFileNames: '[name].cjs',
-      chunkFileNames: '[name]-[hash].cjs'
+      chunkFileNames: '[name]-[hash].cjs',
     },
     {
       format: 'esm',
       dir: './dist',
-      sourcemap: true
-    }
+      sourcemap: true,
+    },
   ],
   external: [/^node:*/, 'poolifier', 'ws'],
   plugins: [
     typescript(),
     del({
-      targets: ['./dist/*']
-    })
-  ]
+      targets: ['./dist/*'],
+    }),
+  ],
 })
index 16dd38d6a102af0eee66dbb842096195803fdae4..200afb357e222b440e43613e88e867161016eb9f 100644 (file)
@@ -35,6 +35,6 @@ const pool = new FixedClusterPool<WorkerData, WorkerResponse>(
     },
     errorHandler: (e: Error) => {
       console.error('Cluster worker error', e)
-    }
+    },
   }
 )
index 232382f609977568a783a5f779300ab86d111567..a3ab5e28f04b458c68493faadd9125243c2b5b1d 100644 (file)
@@ -6,7 +6,7 @@ import {
   type MessagePayload,
   MessageType,
   type WorkerData,
-  type WorkerResponse
+  type WorkerResponse,
 } from './types.js'
 
 class WebSocketServerWorker extends ClusterWorker<WorkerData, WorkerResponse> {
@@ -28,6 +28,7 @@ class WebSocketServerWorker extends ClusterWorker<WorkerData, WorkerResponse> {
   private static readonly startWebSocketServer = (
     workerData?: WorkerData
   ): WorkerResponse => {
+    // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
     const { port } = workerData!
 
     WebSocketServerWorker.wss = new WebSocketServer({ port }, () => {
@@ -40,7 +41,6 @@ class WebSocketServerWorker extends ClusterWorker<WorkerData, WorkerResponse> {
       ws.on('error', console.error)
       ws.on('message', (message: RawData) => {
         const { type, data } = JSON.parse(
-          // eslint-disable-next-line @typescript-eslint/no-base-to-string
           message.toString()
         ) as MessagePayload<DataPayload>
         switch (type) {
@@ -48,7 +48,7 @@ class WebSocketServerWorker extends ClusterWorker<WorkerData, WorkerResponse> {
             ws.send(
               JSON.stringify({
                 type: MessageType.echo,
-                data
+                data,
               })
             )
             break
@@ -58,8 +58,9 @@ class WebSocketServerWorker extends ClusterWorker<WorkerData, WorkerResponse> {
                 {
                   type: MessageType.factorial,
                   data: {
-                    number: WebSocketServerWorker.factorial(data.number!)
-                  }
+                    // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
+                    number: WebSocketServerWorker.factorial(data.number!),
+                  },
                 },
                 (_, v) => (typeof v === 'bigint' ? v.toString() : v)
               )
@@ -70,7 +71,7 @@ class WebSocketServerWorker extends ClusterWorker<WorkerData, WorkerResponse> {
     })
     return {
       status: true,
-      port: WebSocketServerWorker.wss.options.port
+      port: WebSocketServerWorker.wss.options.port,
     }
   }
 
@@ -78,7 +79,7 @@ class WebSocketServerWorker extends ClusterWorker<WorkerData, WorkerResponse> {
     super(WebSocketServerWorker.startWebSocketServer, {
       killHandler: () => {
         WebSocketServerWorker.wss.close()
-      }
+      },
     })
   }
 }
index 9beb2b7828b077eb5fc00c5ce810b3dd7b148d82..2c73376f6ee4089920e10a12c52560062ef3c2c1 100644 (file)
@@ -1,4 +1,3 @@
-// eslint-disable-next-line import/no-unresolved, n/no-missing-import
 import { WebSocket } from 'ws'
 
 const ws = new WebSocket('ws://localhost:8080')
index e96f480b02d513f9db786199a367be90de7a175c..fb87823561344ea583371ece1829e0b92b8c6c2b 100644 (file)
@@ -6,7 +6,7 @@ export default defineConfig({
   input: [
     './src/main.ts',
     './src/websocket-server-worker.ts',
-    './src/request-handler-worker.ts'
+    './src/request-handler-worker.ts',
   ],
   strictDeprecations: true,
   output: [
@@ -15,19 +15,19 @@ export default defineConfig({
       dir: './dist',
       sourcemap: true,
       entryFileNames: '[name].cjs',
-      chunkFileNames: '[name]-[hash].cjs'
+      chunkFileNames: '[name]-[hash].cjs',
     },
     {
       format: 'esm',
       dir: './dist',
-      sourcemap: true
-    }
+      sourcemap: true,
+    },
   ],
   external: [/^node:*/, 'poolifier', 'ws'],
   plugins: [
     typescript(),
     del({
-      targets: ['./dist/*']
-    })
-  ]
+      targets: ['./dist/*'],
+    }),
+  ],
 })
index f1c755060a118c6177c9f2d814578b305e3c0faa..5ba8805199ed7e40388f2e8eededb464ea8297ac 100644 (file)
@@ -31,11 +31,11 @@ const pool = new FixedClusterPool<ClusterWorkerData, ClusterWorkerResponse>(
           workerFile: requestHandlerWorkerFile,
           enableTasksQueue: true,
           tasksQueueOptions: {
-            concurrency: 8
+            concurrency: 8,
           },
           errorHandler: (e: Error) => {
             console.error('Thread worker error:', e)
-          }
+          },
         })
         .then(response => {
           if (response.status) {
@@ -54,6 +54,6 @@ const pool = new FixedClusterPool<ClusterWorkerData, ClusterWorkerResponse>(
     },
     errorHandler: (e: Error) => {
       console.error('Cluster worker error', e)
-    }
+    },
   }
 )
index 99d303319a19449ee81dcd6107e3227a28c4b68b..444c5179f7de1564d36449fcc64415492e57f74d 100644 (file)
@@ -3,7 +3,7 @@ import { ThreadWorker } from 'poolifier'
 import type {
   DataPayload,
   ThreadWorkerData,
-  ThreadWorkerResponse
+  ThreadWorkerResponse,
 } from './types.js'
 
 class RequestHandlerWorker<
@@ -31,15 +31,16 @@ class RequestHandlerWorker<
       factorial: (workerData?: Data) => {
         return {
           data: {
-            number: RequestHandlerWorker.factorial(workerData!.data.number!)
-          }
+            // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
+            number: RequestHandlerWorker.factorial(workerData!.data.number!),
+          },
         } as unknown as Response
-      }
+      },
     })
   }
 }
 
 export const requestHandlerWorker = new RequestHandlerWorker<
-ThreadWorkerData<DataPayload>,
-ThreadWorkerResponse<DataPayload>
+  ThreadWorkerData<DataPayload>,
+  ThreadWorkerResponse<DataPayload>
 >()
index e52f0c06c9331ee011b17b75c8724974c8329a3b..6aa993d29ebd9d725cfed426535107061dad46e5 100644 (file)
@@ -1,7 +1,7 @@
 import {
   availableParallelism,
   ClusterWorker,
-  DynamicThreadPool
+  DynamicThreadPool,
 } from 'poolifier'
 import { type RawData, WebSocketServer } from 'ws'
 
@@ -12,7 +12,7 @@ import {
   type MessagePayload,
   MessageType,
   type ThreadWorkerData,
-  type ThreadWorkerResponse
+  type ThreadWorkerResponse,
 } from './types.js'
 
 const emptyFunction = (): void => {
@@ -20,24 +20,25 @@ const emptyFunction = (): void => {
 }
 
 class WebSocketServerWorker extends ClusterWorker<
-ClusterWorkerData,
-ClusterWorkerResponse
+  ClusterWorkerData,
+  ClusterWorkerResponse
 > {
   private static wss: WebSocketServer
   private static requestHandlerPool: DynamicThreadPool<
-  ThreadWorkerData<DataPayload>,
-  ThreadWorkerResponse<DataPayload>
+    ThreadWorkerData<DataPayload>,
+    ThreadWorkerResponse<DataPayload>
   >
 
   private static readonly startWebSocketServer = (
     workerData?: ClusterWorkerData
   ): ClusterWorkerResponse => {
     const { port, workerFile, minWorkers, maxWorkers, ...poolOptions } =
+      // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
       workerData!
 
     WebSocketServerWorker.requestHandlerPool = new DynamicThreadPool<
-    ThreadWorkerData<DataPayload>,
-    ThreadWorkerResponse<DataPayload>
+      ThreadWorkerData<DataPayload>,
+      ThreadWorkerResponse<DataPayload>
     >(
       minWorkers ?? 1,
       maxWorkers ?? availableParallelism(),
@@ -55,7 +56,6 @@ ClusterWorkerResponse
       ws.on('error', console.error)
       ws.on('message', (message: RawData) => {
         const { type, data } = JSON.parse(
-          // eslint-disable-next-line @typescript-eslint/no-base-to-string
           message.toString()
         ) as MessagePayload<DataPayload>
         switch (type) {
@@ -66,7 +66,7 @@ ClusterWorkerResponse
                 ws.send(
                   JSON.stringify({
                     type: MessageType.echo,
-                    data: response.data
+                    data: response.data,
                   })
                 )
                 return undefined
@@ -81,7 +81,7 @@ ClusterWorkerResponse
                   JSON.stringify(
                     {
                       type: MessageType.factorial,
-                      data: response.data
+                      data: response.data,
                     },
                     (_, v) => (typeof v === 'bigint' ? v.toString() : v)
                   )
@@ -95,7 +95,7 @@ ClusterWorkerResponse
     })
     return {
       status: true,
-      port: WebSocketServerWorker.wss.options.port
+      port: WebSocketServerWorker.wss.options.port,
     }
   }
 
@@ -104,7 +104,7 @@ ClusterWorkerResponse
       killHandler: async () => {
         await WebSocketServerWorker.requestHandlerPool.destroy()
         WebSocketServerWorker.wss.close()
-      }
+      },
     })
   }
 }
index 9beb2b7828b077eb5fc00c5ce810b3dd7b148d82..2c73376f6ee4089920e10a12c52560062ef3c2c1 100644 (file)
@@ -1,4 +1,3 @@
-// eslint-disable-next-line import/no-unresolved, n/no-missing-import
 import { WebSocket } from 'ws'
 
 const ws = new WebSocket('ws://localhost:8080')
index 7a162499d8f91417246fe1b94289b62083ec584d..2954cbdec897d26f495e705b65118388f069e1da 100644 (file)
@@ -18,7 +18,6 @@ wss.on('connection', ws => {
   ws.on('error', console.error)
   ws.on('message', (message: RawData) => {
     const { type, data } = JSON.parse(
-      // eslint-disable-next-line @typescript-eslint/no-base-to-string
       message.toString()
     ) as MessagePayload<DataPayload>
     switch (type) {
@@ -29,7 +28,7 @@ wss.on('connection', ws => {
             ws.send(
               JSON.stringify({
                 type: MessageType.echo,
-                data: response.data
+                data: response.data,
               })
             )
             return undefined
@@ -44,7 +43,7 @@ wss.on('connection', ws => {
               JSON.stringify(
                 {
                   type: MessageType.factorial,
-                  data: response.data
+                  data: response.data,
                 },
                 (_, v) => (typeof v === 'bigint' ? v.toString() : v)
               )
index ac8b9c8657049774d9cccba0bf2173e1b6fe07d8..1cefa60cb421c78a3ecc7312ebdb45ea0e236243 100644 (file)
@@ -11,14 +11,14 @@ const workerFile = join(
 )
 
 export const requestHandlerPool = new DynamicThreadPool<
-WorkerData<DataPayload>,
-WorkerResponse<DataPayload>
+  WorkerData<DataPayload>,
+  WorkerResponse<DataPayload>
 >(1, availableParallelism(), workerFile, {
   enableTasksQueue: true,
   tasksQueueOptions: {
-    concurrency: 8
+    concurrency: 8,
   },
   errorHandler: (e: Error) => {
     console.error('Thread worker error:', e)
-  }
+  },
 })
index 92baa166073a0784025fe77d4b4dfb67ed7f1b2f..2c4de3e2735439e96d0f78b8f322f3a1cbd35af2 100644 (file)
@@ -27,15 +27,16 @@ class RequestHandlerWorker<
       factorial: (workerData?: Data) => {
         return {
           data: {
-            number: RequestHandlerWorker.factorial(workerData!.data.number!)
-          }
+            // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
+            number: RequestHandlerWorker.factorial(workerData!.data.number!),
+          },
         } as unknown as Response
-      }
+      },
     })
   }
 }
 
 export const requestHandlerWorker = new RequestHandlerWorker<
-WorkerData<DataPayload>,
-WorkerResponse<DataPayload>
+  WorkerData<DataPayload>,
+  WorkerResponse<DataPayload>
 >()
index 1d8af8d904555461173c214fc35172f53160d82e..7ab1fc5649e0c0ec366a67225304e9fc9577e47e 100644 (file)
@@ -12,7 +12,7 @@ export interface MyResponse {
 class MyThreadWorker extends ThreadWorker<MyData, MyResponse> {
   constructor () {
     super(async (data?: MyData) => await this.process(data), {
-      maxInactiveTime: 60000
+      maxInactiveTime: 60000,
     })
   }
 
index c1743f260c028e3565b16cdeee7c5f56c38d3a29..38b989d6f22febfbe7360257d308c5bb295ed826 100644 (file)
     "@biomejs/biome": "^1.7.3",
     "@commitlint/cli": "^19.3.0",
     "@commitlint/config-conventional": "^19.2.2",
+    "@cspell/eslint-plugin": "^8.8.3",
+    "@eslint/js": "^9.3.0",
     "@release-it/bumper": "^6.0.1",
     "@release-it/keep-a-changelog": "^5.0.0",
     "@rollup/plugin-terser": "^0.4.4",
     "@rollup/plugin-typescript": "^11.1.6",
     "@types/node": "^20.12.13",
-    "@typescript-eslint/eslint-plugin": "^7.11.0",
-    "@typescript-eslint/parser": "^7.11.0",
     "c8": "^9.1.0",
     "cross-env": "^7.0.3",
-    "eslint": "^8.57.0",
-    "eslint-config-love": "^47.0.0",
-    "eslint-config-standard": "^17.1.0",
+    "eslint": "^9.3.0",
     "eslint-define-config": "^2.1.0",
-    "eslint-import-resolver-typescript": "^3.6.1",
-    "eslint-plugin-import": "^2.29.1",
     "eslint-plugin-jsdoc": "^48.2.7",
     "eslint-plugin-n": "^17.7.0",
-    "eslint-plugin-promise": "^6.2.0",
     "eslint-plugin-simple-import-sort": "^12.1.0",
-    "eslint-plugin-spellcheck": "^0.0.20",
-    "eslint-plugin-tsdoc": "^0.3.0",
     "expect": "^29.7.0",
+    "globals": "^15.3.0",
     "husky": "^9.0.11",
     "lint-staged": "^15.2.5",
     "mocha": "^10.4.0",
     "mochawesome": "^7.1.3",
+    "neostandard": "^0.5.1",
     "prettier": "^3.2.5",
     "release-it": "^17.3.0",
     "rollup": "^4.18.0",
index 7a29e946eeda953c5baa0c2e64fccfcf055448db..0ccb25c5781603b318a2dd06c2bb31c07da66494 100644 (file)
@@ -20,6 +20,12 @@ importers:
       '@commitlint/config-conventional':
         specifier: ^19.2.2
         version: 19.2.2
+      '@cspell/eslint-plugin':
+        specifier: ^8.8.3
+        version: 8.8.3(eslint@9.3.0)
+      '@eslint/js':
+        specifier: ^9.3.0
+        version: 9.3.0
       '@release-it/bumper':
         specifier: ^6.0.1
         version: 6.0.1(release-it@17.3.0(typescript@5.4.5))
@@ -35,12 +41,6 @@ importers:
       '@types/node':
         specifier: ^20.12.13
         version: 20.12.13
-      '@typescript-eslint/eslint-plugin':
-        specifier: ^7.11.0
-        version: 7.11.0(@typescript-eslint/parser@7.11.0(eslint@8.57.0)(typescript@5.4.5))(eslint@8.57.0)(typescript@5.4.5)
-      '@typescript-eslint/parser':
-        specifier: ^7.11.0
-        version: 7.11.0(eslint@8.57.0)(typescript@5.4.5)
       c8:
         specifier: ^9.1.0
         version: 9.1.0
@@ -48,44 +48,26 @@ importers:
         specifier: ^7.0.3
         version: 7.0.3
       eslint:
-        specifier: ^8.57.0
-        version: 8.57.0
-      eslint-config-love:
-        specifier: ^47.0.0
-        version: 47.0.0(@typescript-eslint/eslint-plugin@7.11.0(@typescript-eslint/parser@7.11.0(eslint@8.57.0)(typescript@5.4.5))(eslint@8.57.0)(typescript@5.4.5))(eslint-plugin-import@2.29.1(@typescript-eslint/parser@7.11.0(eslint@8.57.0)(typescript@5.4.5))(eslint-import-resolver-typescript@3.6.1)(eslint@8.57.0))(eslint-plugin-n@17.7.0(eslint@8.57.0))(eslint-plugin-promise@6.2.0(eslint@8.57.0))(eslint@8.57.0)(typescript@5.4.5)
-      eslint-config-standard:
-        specifier: ^17.1.0
-        version: 17.1.0(eslint-plugin-import@2.29.1(@typescript-eslint/parser@7.11.0(eslint@8.57.0)(typescript@5.4.5))(eslint-import-resolver-typescript@3.6.1)(eslint@8.57.0))(eslint-plugin-n@17.7.0(eslint@8.57.0))(eslint-plugin-promise@6.2.0(eslint@8.57.0))(eslint@8.57.0)
+        specifier: ^9.3.0
+        version: 9.3.0
       eslint-define-config:
         specifier: ^2.1.0
         version: 2.1.0
-      eslint-import-resolver-typescript:
-        specifier: ^3.6.1
-        version: 3.6.1(@typescript-eslint/parser@7.11.0(eslint@8.57.0)(typescript@5.4.5))(eslint-plugin-import@2.29.1)(eslint@8.57.0)
-      eslint-plugin-import:
-        specifier: ^2.29.1
-        version: 2.29.1(@typescript-eslint/parser@7.11.0(eslint@8.57.0)(typescript@5.4.5))(eslint-import-resolver-typescript@3.6.1)(eslint@8.57.0)
       eslint-plugin-jsdoc:
         specifier: ^48.2.7
-        version: 48.2.7(eslint@8.57.0)
+        version: 48.2.7(eslint@9.3.0)
       eslint-plugin-n:
         specifier: ^17.7.0
-        version: 17.7.0(eslint@8.57.0)
-      eslint-plugin-promise:
-        specifier: ^6.2.0
-        version: 6.2.0(eslint@8.57.0)
+        version: 17.7.0(eslint@9.3.0)
       eslint-plugin-simple-import-sort:
         specifier: ^12.1.0
-        version: 12.1.0(eslint@8.57.0)
-      eslint-plugin-spellcheck:
-        specifier: ^0.0.20
-        version: 0.0.20(eslint@8.57.0)
-      eslint-plugin-tsdoc:
-        specifier: ^0.3.0
-        version: 0.3.0
+        version: 12.1.0(eslint@9.3.0)
       expect:
         specifier: ^29.7.0
         version: 29.7.0
+      globals:
+        specifier: ^15.3.0
+        version: 15.3.0
       husky:
         specifier: ^9.0.11
         version: 9.0.11
@@ -98,6 +80,9 @@ importers:
       mochawesome:
         specifier: ^7.1.3
         version: 7.1.3(mocha@10.4.0)
+      neostandard:
+        specifier: ^0.5.1
+        version: 0.5.1(@typescript-eslint/parser@8.0.0-alpha.23(eslint@9.3.0)(typescript@5.4.5))(eslint@9.3.0)(typescript@5.4.5)
       prettier:
         specifier: ^3.2.5
         version: 3.2.5
@@ -271,6 +256,199 @@ packages:
     resolution: {integrity: sha512-tpyc+7i6bPG9mvaBbtKUeghfyZSDgWquIDfMgqYtTbmZ9Y9VzEm2je9EYcQ0aoz5o7NvGS+rcDec93yO08MHYA==}
     engines: {node: '>=v18'}
 
+  '@cspell/cspell-bundled-dicts@8.8.3':
+    resolution: {integrity: sha512-nRa30TQwE4R5xcM6CBibM2l7D359ympexjm7OrykzYmStIiiudDIsuNOIXGBrDouxRFgKGAa/ETo1g+Pxz7kNA==}
+    engines: {node: '>=18'}
+
+  '@cspell/cspell-pipe@8.8.3':
+    resolution: {integrity: sha512-tzngpFKXeUsdTZEErffTlwUnPIKYgyRKy0YTrD77EkhyDSbUnaS8JWqtGZbKV7iQ+R4CL7tiaubPjUzkbWj+kQ==}
+    engines: {node: '>=18'}
+
+  '@cspell/cspell-resolver@8.8.3':
+    resolution: {integrity: sha512-pMOB2MJYeria0DeW1dsehRPIHLzoOXCm1Cdjp1kRZ931PbqNCYaE/GM6laWpUTAbS9Ly2tv4g0jK3PUH8ZTtJA==}
+    engines: {node: '>=18'}
+
+  '@cspell/cspell-service-bus@8.8.3':
+    resolution: {integrity: sha512-QVKe/JZvoTaaBAMXG40HjZib1g6rGgxk03e070GmdfCiMRUCWFtK+9DKVYJfSqjQhzj/eDCrq8aWplHWy66umg==}
+    engines: {node: '>=18'}
+
+  '@cspell/cspell-types@8.8.3':
+    resolution: {integrity: sha512-31wYSBPinhqKi9TSzPg50fWHJmMQwD1d5p26yM/NAfNQvjAfBQlrg4pqix8pxOJkAK5W/TnoaVXjzJ5XCg6arQ==}
+    engines: {node: '>=18'}
+
+  '@cspell/dict-ada@4.0.2':
+    resolution: {integrity: sha512-0kENOWQeHjUlfyId/aCM/mKXtkEgV0Zu2RhUXCBr4hHo9F9vph+Uu8Ww2b0i5a4ZixoIkudGA+eJvyxrG1jUpA==}
+
+  '@cspell/dict-aws@4.0.2':
+    resolution: {integrity: sha512-aNGHWSV7dRLTIn8WJemzLoMF62qOaiUQlgnsCwH5fRCD/00gsWCwg106pnbkmK4AyabyxzneOV4dfecDJWkSxw==}
+
+  '@cspell/dict-bash@4.1.3':
+    resolution: {integrity: sha512-tOdI3QVJDbQSwPjUkOiQFhYcu2eedmX/PtEpVWg0aFps/r6AyjUQINtTgpqMYnYuq8O1QUIQqnpx21aovcgZCw==}
+
+  '@cspell/dict-companies@3.1.2':
+    resolution: {integrity: sha512-OwR5i1xbYuJX7FtHQySmTy3iJtPV1rZQ3jFCxFGwrA1xRQ4rtRcDQ+sTXBCIAoJHkXa84f9J3zsngOKmMGyS/w==}
+
+  '@cspell/dict-cpp@5.1.8':
+    resolution: {integrity: sha512-X5uq0uRqN6cyOZOZV1YKi6g8sBtd0+VoF5NbDWURahGR8TRsiztH0sNqs0IB3X0dW4GakU+n9SXcuEmxynkSsw==}
+
+  '@cspell/dict-cryptocurrencies@5.0.0':
+    resolution: {integrity: sha512-Z4ARIw5+bvmShL+4ZrhDzGhnc9znaAGHOEMaB/GURdS/jdoreEDY34wdN0NtdLHDO5KO7GduZnZyqGdRoiSmYA==}
+
+  '@cspell/dict-csharp@4.0.2':
+    resolution: {integrity: sha512-1JMofhLK+4p4KairF75D3A924m5ERMgd1GvzhwK2geuYgd2ZKuGW72gvXpIV7aGf52E3Uu1kDXxxGAiZ5uVG7g==}
+
+  '@cspell/dict-css@4.0.12':
+    resolution: {integrity: sha512-vGBgPM92MkHQF5/2jsWcnaahOZ+C6OE/fPvd5ScBP72oFY9tn5GLuomcyO0z8vWCr2e0nUSX1OGimPtcQAlvSw==}
+
+  '@cspell/dict-dart@2.0.3':
+    resolution: {integrity: sha512-cLkwo1KT5CJY5N5RJVHks2genFkNCl/WLfj+0fFjqNR+tk3tBI1LY7ldr9piCtSFSm4x9pO1x6IV3kRUY1lLiw==}
+
+  '@cspell/dict-data-science@1.0.11':
+    resolution: {integrity: sha512-TaHAZRVe0Zlcc3C23StZqqbzC0NrodRwoSAc8dis+5qLeLLnOCtagYQeROQvDlcDg3X/VVEO9Whh4W/z4PAmYQ==}
+
+  '@cspell/dict-django@4.1.0':
+    resolution: {integrity: sha512-bKJ4gPyrf+1c78Z0Oc4trEB9MuhcB+Yg+uTTWsvhY6O2ncFYbB/LbEZfqhfmmuK/XJJixXfI1laF2zicyf+l0w==}
+
+  '@cspell/dict-docker@1.1.7':
+    resolution: {integrity: sha512-XlXHAr822euV36GGsl2J1CkBIVg3fZ6879ZOg5dxTIssuhUOCiV2BuzKZmt6aIFmcdPmR14+9i9Xq+3zuxeX0A==}
+
+  '@cspell/dict-dotnet@5.0.2':
+    resolution: {integrity: sha512-UD/pO2A2zia/YZJ8Kck/F6YyDSpCMq0YvItpd4YbtDVzPREfTZ48FjZsbYi4Jhzwfvc6o8R56JusAE58P+4sNQ==}
+
+  '@cspell/dict-elixir@4.0.3':
+    resolution: {integrity: sha512-g+uKLWvOp9IEZvrIvBPTr/oaO6619uH/wyqypqvwpmnmpjcfi8+/hqZH8YNKt15oviK8k4CkINIqNhyndG9d9Q==}
+
+  '@cspell/dict-en-common-misspellings@2.0.1':
+    resolution: {integrity: sha512-uWaP8UG4uvcPyqaG0FzPKCm5kfmhsiiQ45Fs6b3/AEAqfq7Fj1JW0+S3qRt85FQA9SoU6gUJCz9wkK/Ylh7m5A==}
+
+  '@cspell/dict-en-gb@1.1.33':
+    resolution: {integrity: sha512-tKSSUf9BJEV+GJQAYGw5e+ouhEe2ZXE620S7BLKe3ZmpnjlNG9JqlnaBhkIMxKnNFkLY2BP/EARzw31AZnOv4g==}
+
+  '@cspell/dict-en_us@4.3.21':
+    resolution: {integrity: sha512-Bzoo2aS4Pej/MGIFlATpp0wMt9IzVHrhDjdV7FgkAIXbjrOn67ojbTxCgWs8AuCNVfK8lBYGEvs5+ElH1msF8w==}
+
+  '@cspell/dict-filetypes@3.0.4':
+    resolution: {integrity: sha512-IBi8eIVdykoGgIv5wQhOURi5lmCNJq0we6DvqKoPQJHthXbgsuO1qrHSiUVydMiQl/XvcnUWTMeAlVUlUClnVg==}
+
+  '@cspell/dict-fonts@4.0.0':
+    resolution: {integrity: sha512-t9V4GeN/m517UZn63kZPUYP3OQg5f0OBLSd3Md5CU3eH1IFogSvTzHHnz4Wqqbv8NNRiBZ3HfdY/pqREZ6br3Q==}
+
+  '@cspell/dict-fsharp@1.0.1':
+    resolution: {integrity: sha512-23xyPcD+j+NnqOjRHgW3IU7Li912SX9wmeefcY0QxukbAxJ/vAN4rBpjSwwYZeQPAn3fxdfdNZs03fg+UM+4yQ==}
+
+  '@cspell/dict-fullstack@3.1.8':
+    resolution: {integrity: sha512-YRlZupL7uqMCtEBK0bDP9BrcPnjDhz7m4GBqCc1EYqfXauHbLmDT8ELha7T/E7wsFKniHSjzwDZzhNXo2lusRQ==}
+
+  '@cspell/dict-gaming-terms@1.0.5':
+    resolution: {integrity: sha512-C3riccZDD3d9caJQQs1+MPfrUrQ+0KHdlj9iUR1QD92FgTOF6UxoBpvHUUZ9YSezslcmpFQK4xQQ5FUGS7uWfw==}
+
+  '@cspell/dict-git@3.0.0':
+    resolution: {integrity: sha512-simGS/lIiXbEaqJu9E2VPoYW1OTC2xrwPPXNXFMa2uo/50av56qOuaxDrZ5eH1LidFXwoc8HROCHYeKoNrDLSw==}
+
+  '@cspell/dict-golang@6.0.9':
+    resolution: {integrity: sha512-etDt2WQauyEQDA+qPS5QtkYTb2I9l5IfQftAllVoB1aOrT6bxxpHvMEpJ0Hsn/vezxrCqa/BmtUbRxllIxIuSg==}
+
+  '@cspell/dict-google@1.0.1':
+    resolution: {integrity: sha512-dQr4M3n95uOhtloNSgB9tYYGXGGEGEykkFyRtfcp5pFuEecYUa0BSgtlGKx9RXVtJtKgR+yFT/a5uQSlt8WjqQ==}
+
+  '@cspell/dict-haskell@4.0.1':
+    resolution: {integrity: sha512-uRrl65mGrOmwT7NxspB4xKXFUenNC7IikmpRZW8Uzqbqcu7ZRCUfstuVH7T1rmjRgRkjcIjE4PC11luDou4wEQ==}
+
+  '@cspell/dict-html-symbol-entities@4.0.0':
+    resolution: {integrity: sha512-HGRu+48ErJjoweR5IbcixxETRewrBb0uxQBd6xFGcxbEYCX8CnQFTAmKI5xNaIt2PKaZiJH3ijodGSqbKdsxhw==}
+
+  '@cspell/dict-html@4.0.5':
+    resolution: {integrity: sha512-p0brEnRybzSSWi8sGbuVEf7jSTDmXPx7XhQUb5bgG6b54uj+Z0Qf0V2n8b/LWwIPJNd1GygaO9l8k3HTCy1h4w==}
+
+  '@cspell/dict-java@5.0.6':
+    resolution: {integrity: sha512-kdE4AHHHrixyZ5p6zyms1SLoYpaJarPxrz8Tveo6gddszBVVwIUZ+JkQE1bWNLK740GWzIXdkznpUfw1hP9nXw==}
+
+  '@cspell/dict-julia@1.0.1':
+    resolution: {integrity: sha512-4JsCLCRhhLMLiaHpmR7zHFjj1qOauzDI5ZzCNQS31TUMfsOo26jAKDfo0jljFAKgw5M2fEG7sKr8IlPpQAYrmQ==}
+
+  '@cspell/dict-k8s@1.0.5':
+    resolution: {integrity: sha512-Cj+/ZV4S+MKlwfocSJZqe/2UAd/sY8YtlZjbK25VN1nCnrsKrBjfkX29vclwSj1U9aJg4Z9jw/uMjoaKu9ZrpQ==}
+
+  '@cspell/dict-latex@4.0.0':
+    resolution: {integrity: sha512-LPY4y6D5oI7D3d+5JMJHK/wxYTQa2lJMSNxps2JtuF8hbAnBQb3igoWEjEbIbRRH1XBM0X8dQqemnjQNCiAtxQ==}
+
+  '@cspell/dict-lorem-ipsum@4.0.0':
+    resolution: {integrity: sha512-1l3yjfNvMzZPibW8A7mQU4kTozwVZVw0AvFEdy+NcqtbxH+TvbSkNMqROOFWrkD2PjnKG0+Ea0tHI2Pi6Gchnw==}
+
+  '@cspell/dict-lua@4.0.3':
+    resolution: {integrity: sha512-lDHKjsrrbqPaea13+G9s0rtXjMO06gPXPYRjRYawbNmo4E/e3XFfVzeci3OQDQNDmf2cPOwt9Ef5lu2lDmwfJg==}
+
+  '@cspell/dict-makefile@1.0.0':
+    resolution: {integrity: sha512-3W9tHPcSbJa6s0bcqWo6VisEDTSN5zOtDbnPabF7rbyjRpNo0uHXHRJQF8gAbFzoTzBBhgkTmrfSiuyQm7vBUQ==}
+
+  '@cspell/dict-monkeyc@1.0.6':
+    resolution: {integrity: sha512-oO8ZDu/FtZ55aq9Mb67HtaCnsLn59xvhO/t2mLLTHAp667hJFxpp7bCtr2zOrR1NELzFXmKln/2lw/PvxMSvrA==}
+
+  '@cspell/dict-node@5.0.1':
+    resolution: {integrity: sha512-lax/jGz9h3Dv83v8LHa5G0bf6wm8YVRMzbjJPG/9rp7cAGPtdrga+XANFq+B7bY5+jiSA3zvj10LUFCFjnnCCg==}
+
+  '@cspell/dict-npm@5.0.16':
+    resolution: {integrity: sha512-ZWPnLAziEcSCvV0c8k9Qj88pfMu+wZwM5Qks87ShsfBgI8uLZ9tGHravA7gmjH1Gd7Bgxy2ulvXtSqIWPh1lew==}
+
+  '@cspell/dict-php@4.0.7':
+    resolution: {integrity: sha512-SUCOBfRDDFz1E2jnAZIIuy8BNbCc8i+VkiL9g4HH9tTN6Nlww5Uz2pMqYS6rZQkXuubqsbkbPlsRiuseEnTmYA==}
+
+  '@cspell/dict-powershell@5.0.4':
+    resolution: {integrity: sha512-eosDShapDgBWN9ULF7+sRNdUtzRnUdsfEdBSchDm8FZA4HOqxUSZy3b/cX/Rdw0Fnw0AKgk0kzgXw7tS6vwJMQ==}
+
+  '@cspell/dict-public-licenses@2.0.7':
+    resolution: {integrity: sha512-KlBXuGcN3LE7tQi/GEqKiDewWGGuopiAD0zRK1QilOx5Co8XAvs044gk4MNIQftc8r0nHeUI+irJKLGcR36DIQ==}
+
+  '@cspell/dict-python@4.1.11':
+    resolution: {integrity: sha512-XG+v3PumfzUW38huSbfT15Vqt3ihNb462ulfXifpQllPok5OWynhszCLCRQjQReV+dgz784ST4ggRxW452/kVg==}
+
+  '@cspell/dict-r@2.0.1':
+    resolution: {integrity: sha512-KCmKaeYMLm2Ip79mlYPc8p+B2uzwBp4KMkzeLd5E6jUlCL93Y5Nvq68wV5fRLDRTf7N1LvofkVFWfDcednFOgA==}
+
+  '@cspell/dict-ruby@5.0.2':
+    resolution: {integrity: sha512-cIh8KTjpldzFzKGgrqUX4bFyav5lC52hXDKo4LbRuMVncs3zg4hcSf4HtURY+f2AfEZzN6ZKzXafQpThq3dl2g==}
+
+  '@cspell/dict-rust@4.0.3':
+    resolution: {integrity: sha512-8DFCzkFQ+2k3fDaezWc/D+0AyiBBiOGYfSDUfrTNU7wpvUvJ6cRcAUshMI/cn2QW/mmxTspRgVlXsE6GUMz00Q==}
+
+  '@cspell/dict-scala@5.0.2':
+    resolution: {integrity: sha512-v97ClgidZt99JUm7OjhQugDHmhx4U8fcgunHvD/BsXWjXNj4cTr0m0YjofyZoL44WpICsNuFV9F/sv9OM5HUEw==}
+
+  '@cspell/dict-software-terms@3.4.0':
+    resolution: {integrity: sha512-RfrSrvKBaUZ1q3R6eksWe+SMUDNFzAthqXGJuZeylZBO3LdaYdhRDcqFzeMwksfCYjvBYeJ1Ady6NSpdXzESjQ==}
+
+  '@cspell/dict-sql@2.1.3':
+    resolution: {integrity: sha512-SEyTNKJrjqD6PAzZ9WpdSu6P7wgdNtGV2RV8Kpuw1x6bV+YsSptuClYG+JSdRExBTE6LwIe1bTklejUp3ZP8TQ==}
+
+  '@cspell/dict-svelte@1.0.2':
+    resolution: {integrity: sha512-rPJmnn/GsDs0btNvrRBciOhngKV98yZ9SHmg8qI6HLS8hZKvcXc0LMsf9LLuMK1TmS2+WQFAan6qeqg6bBxL2Q==}
+
+  '@cspell/dict-swift@2.0.1':
+    resolution: {integrity: sha512-gxrCMUOndOk7xZFmXNtkCEeroZRnS2VbeaIPiymGRHj5H+qfTAzAKxtv7jJbVA3YYvEzWcVE2oKDP4wcbhIERw==}
+
+  '@cspell/dict-terraform@1.0.0':
+    resolution: {integrity: sha512-Ak+vy4HP/bOgzf06BAMC30+ZvL9mzv21xLM2XtfnBLTDJGdxlk/nK0U6QT8VfFLqJ0ZZSpyOxGsUebWDCTr/zQ==}
+
+  '@cspell/dict-typescript@3.1.5':
+    resolution: {integrity: sha512-EkIwwNV/xqEoBPJml2S16RXj65h1kvly8dfDLgXerrKw6puybZdvAHerAph6/uPTYdtLcsPyJYkPt5ISOJYrtw==}
+
+  '@cspell/dict-vue@3.0.0':
+    resolution: {integrity: sha512-niiEMPWPV9IeRBRzZ0TBZmNnkK3olkOPYxC1Ny2AX4TGlYRajcW0WUtoSHmvvjZNfWLSg2L6ruiBeuPSbjnG6A==}
+
+  '@cspell/dynamic-import@8.8.3':
+    resolution: {integrity: sha512-qpxGC2hGVfbSaLJkaEu//rqbgAOjYnMlbxD75Fk9ny96sr+ZI1YC0nmUErWlgXSbtjVY/DHCOu26Usweo5iRgA==}
+    engines: {node: '>=18.0'}
+
+  '@cspell/eslint-plugin@8.8.3':
+    resolution: {integrity: sha512-N32SkoOa9DoUkfhsaGHg2mZHYUx8Tt0M4d34UAnbbqYEFwYP6wfrAzMhX35vicX1kh1KHeoSUsr5PukUhx8GzQ==}
+    engines: {node: '>=18'}
+    peerDependencies:
+      eslint: ^7 || ^8 || ^9
+
+  '@cspell/strong-weak-map@8.8.3':
+    resolution: {integrity: sha512-y/pL7Zex8iHQ54qDYvg9oCiCgfZ9DAUTOI/VtPFVC+42JqLx6YufYxJS2uAsFlfAXIPiRV8qnnG6BHImD1Ix6g==}
+    engines: {node: '>=18'}
+
   '@es-joy/jsdoccomment@0.43.1':
     resolution: {integrity: sha512-I238eDtOolvCuvtxrnqtlBaw0BwdQuYqK7eA6XIonicMdOOOb75mqdIzkGDUbS04+1Di007rgm9snFRNeVrOog==}
     engines: {node: '>=16'}
@@ -285,16 +463,16 @@ packages:
     resolution: {integrity: sha512-Cu96Sd2By9mCNTx2iyKOmq10v22jUVQv0lQnlGNy16oE9589yE+QADPbrMGCkA51cKZSg3Pu/aTJVTGfL/qjUA==}
     engines: {node: ^12.0.0 || ^14.0.0 || >=16.0.0}
 
-  '@eslint/eslintrc@2.1.4':
-    resolution: {integrity: sha512-269Z39MS6wVJtsoUl10L60WdkhJVdPG24Q4eZTH3nnF6lpvSShEK3wQjDX9JRWAUPvPh7COouPpU9IrqaZFvtQ==}
-    engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
+  '@eslint/eslintrc@3.1.0':
+    resolution: {integrity: sha512-4Bfj15dVJdoy3RfZmmo86RK1Fwzn6SstsvK9JS+BaVKqC6QQQQyXekNaC+g+LKNgkQ+2VhGAzm6hO40AhMR3zQ==}
+    engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
 
-  '@eslint/js@8.57.0':
-    resolution: {integrity: sha512-Ys+3g2TaW7gADOJzPt83SJtCDhMjndcDMFVQ/Tj9iA1BfJzFKD9mAUXT3OenpuPHbI6P/myECxRJrofUsDx/5g==}
-    engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
+  '@eslint/js@9.3.0':
+    resolution: {integrity: sha512-niBqk8iwv96+yuTwjM6bWg8ovzAPF9qkICsGtcoa5/dmqcEMfdwNAX7+/OHcJHc7wj7XqPxH98oAHytFYlw6Sw==}
+    engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
 
-  '@humanwhocodes/config-array@0.11.14':
-    resolution: {integrity: sha512-3T8LkOmg45BV5FICb15QQMsyUSWrQ8AygVfC7ZG32zOalnqrilm018ZVCw0eapXux8FtA33q8PSRSstjee3jSg==}
+  '@humanwhocodes/config-array@0.13.0':
+    resolution: {integrity: sha512-DZLEEqFWQFiyK6h5YIeynKx7JlvCYWL0cImfSRXZ9l4Sg2efkFGTuFf6vzXjK1cq6IYkU+Eg/JizXw+TD2vRNw==}
     engines: {node: '>=10.10.0'}
 
   '@humanwhocodes/module-importer@1.0.1':
@@ -304,6 +482,10 @@ packages:
   '@humanwhocodes/object-schema@2.0.3':
     resolution: {integrity: sha512-93zYdMES/c1D69yZiKDBj0V24vqNzB/koF26KPaagAfd3P/4gUlh3Dys5ogAK+Exi9QyzlD8x/08Zt7wIKcDcA==}
 
+  '@humanwhocodes/retry@0.3.0':
+    resolution: {integrity: sha512-d2CGZR2o7fS6sWB7DG/3a95bGKQyHMACZ5aW8qGkkqQpUoZV6C0X7Pc7l4ZNMZkfNBf4VWNe9E1jRsf0G146Ew==}
+    engines: {node: '>=18.18'}
+
   '@iarna/toml@2.2.5':
     resolution: {integrity: sha512-trnsAYxU3xnS1gPHPyU961coFyLkh4gAD/0zQ5mymY4yOZ+CYvsPqUbOFSw0aDM4y0tV7tiFxL/1XfXPNC6IPg==}
 
@@ -352,12 +534,6 @@ packages:
     resolution: {integrity: sha512-/gKJun8NNiWGZJkGzI/Ragc53cOdcLNdzjLaIa+GEjguQs0ulsurx8WN0jijdK9yPqDvziX995sMRLyLt1uZMQ==}
     engines: {node: '>= 0.4'}
 
-  '@microsoft/tsdoc-config@0.17.0':
-    resolution: {integrity: sha512-v/EYRXnCAIHxOHW+Plb6OWuUoMotxTN0GLatnpOb1xq0KuTNw/WI3pamJx/UbsoJP5k9MCw1QxvvhPcF9pH3Zg==}
-
-  '@microsoft/tsdoc@0.15.0':
-    resolution: {integrity: sha512-HZpPoABogPvjeJOdzCOSJsXeL/SMCBgBZMVC3X3d7YYp2gf31MfxhUoYUNwf1ERPJOnQc0wkFn9trqI6ZEdZuA==}
-
   '@nodelib/fs.scandir@2.1.5':
     resolution: {integrity: sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==}
     engines: {node: '>= 8'}
@@ -422,6 +598,10 @@ packages:
   '@octokit/types@13.5.0':
     resolution: {integrity: sha512-HdqWTf5Z3qwDVlzCrP8UJquMwunpDiMPt5er+QjGzL4hqr/vBVY/MauQgS1xWxCDT1oMx1EULyqxncdCY/NVSQ==}
 
+  '@pkgr/core@0.1.1':
+    resolution: {integrity: sha512-cq8o4cWH0ibXh9VGi5P20Tu9XF/0fFXl9EUinr9QfTM7a7p0oTA4iJRCQWppXR1Pg8dSM0UCItCkPwsk9qWWYA==}
+    engines: {node: ^12.20.0 || ^14.18.0 || >=16.0.0}
+
   '@pnpm/config.env-replace@1.1.0':
     resolution: {integrity: sha512-htyl8TWnKL7K/ESFa1oW2UB5lVDxuF5DpM7tBi6Hu2LNL3mWkIzNLG6N4zoCUP1lCKNxWy/3iu8mS8MvToGd6w==}
     engines: {node: '>=12.22.0'}
@@ -583,6 +763,35 @@ packages:
   '@sinonjs/text-encoding@0.7.2':
     resolution: {integrity: sha512-sXXKG+uL9IrKqViTtao2Ws6dy0znu9sOaP1di/jKGW1M6VssO8vlpXCQcpZ+jisQ1tTFAC5Jo/EOzFbggBagFQ==}
 
+  '@stylistic/eslint-plugin-js@1.8.1':
+    resolution: {integrity: sha512-c5c2C8Mos5tTQd+NWpqwEu7VT6SSRooAguFPMj1cp2RkTYl1ynKoXo8MWy3k4rkbzoeYHrqC2UlUzsroAN7wtQ==}
+    engines: {node: ^16.0.0 || >=18.0.0}
+    peerDependencies:
+      eslint: '>=8.40.0'
+
+  '@stylistic/eslint-plugin-jsx@1.8.1':
+    resolution: {integrity: sha512-k1Eb6rcjMP+mmjvj+vd9y5KUdWn1OBkkPLHXhsrHt5lCDFZxJEs0aVQzE5lpYrtVZVkpc5esTtss/cPJux0lfA==}
+    engines: {node: ^16.0.0 || >=18.0.0}
+    peerDependencies:
+      eslint: '>=8.40.0'
+
+  '@stylistic/eslint-plugin-plus@1.8.1':
+    resolution: {integrity: sha512-4+40H3lHYTN8OWz+US8CamVkO+2hxNLp9+CAjorI7top/lHqemhpJvKA1LD9Uh+WMY9DYWiWpL2+SZ2wAXY9fQ==}
+    peerDependencies:
+      eslint: '*'
+
+  '@stylistic/eslint-plugin-ts@1.8.1':
+    resolution: {integrity: sha512-/q1m+ZuO1JHfiSF16EATFzv7XSJkc5W6DocfvH5o9oB6WWYFMF77fVoBWnKT3wGptPOc2hkRupRKhmeFROdfWA==}
+    engines: {node: ^16.0.0 || >=18.0.0}
+    peerDependencies:
+      eslint: '>=8.40.0'
+
+  '@stylistic/eslint-plugin@1.8.1':
+    resolution: {integrity: sha512-64My6I7uCcmSQ//427Pfg2vjSf9SDzfsGIWohNFgISMLYdC5BzJqDo647iDDJzSxINh3WTC0Ql46ifiKuOoTyA==}
+    engines: {node: ^16.0.0 || >=18.0.0}
+    peerDependencies:
+      eslint: '>=8.40.0'
+
   '@szmarczak/http-timer@5.0.1':
     resolution: {integrity: sha512-+PmQX0PiAYPMeVYe237LJAYvOMYW1j2rH5YROyS3b4CTVJum34HfRvKvAzozHAQG0TnHNdUfY9nCeUyRAs//cw==}
     engines: {node: '>=14.16'}
@@ -617,15 +826,15 @@ packages:
   '@types/json-schema@7.0.15':
     resolution: {integrity: sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==}
 
-  '@types/json5@0.0.29':
-    resolution: {integrity: sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==}
-
   '@types/minimatch@5.1.2':
     resolution: {integrity: sha512-K0VQKziLUWkVKiRVrx4a40iPaxTUefQmjtkQofBkYRcoaaL/8rhwDWww9qWbrgicNOgnpIsMxyNIUM4+n6dUIA==}
 
   '@types/node@20.12.13':
     resolution: {integrity: sha512-gBGeanV41c1L171rR7wjbMiEpEI/l5XFQdLLfhr/REwpgDy/4U8y89+i8kRiLzDyZdOkXh+cRaTetUnCYutoXA==}
 
+  '@types/semver@7.5.8':
+    resolution: {integrity: sha512-I8EUhyrgfLrcTkzV3TSsGyl1tSuPrEDzr0yd5m90UgNxQkyDXULk3b6MlQqTCpZpNtWe1K0hzclnZkTcLBe2UQ==}
+
   '@types/stack-utils@2.0.3':
     resolution: {integrity: sha512-9aEbYZ3TbYMznPdcdr3SmIrLXwC/AKZXQeCf9Pgao5CKb8CyHuEX5jzWPTkvregvhRJHcpRO6BFoGW9ycaOkYw==}
 
@@ -635,66 +844,93 @@ packages:
   '@types/yargs@17.0.32':
     resolution: {integrity: sha512-xQ67Yc/laOG5uMfX/093MRlGGCIBzZMarVa+gfNKJxWAIgykYpVGkBdbqEzGDDfCrVUj6Hiff4mTZ5BA6TmAog==}
 
-  '@typescript-eslint/eslint-plugin@7.11.0':
-    resolution: {integrity: sha512-P+qEahbgeHW4JQ/87FuItjBj8O3MYv5gELDzr8QaQ7fsll1gSMTYb6j87MYyxwf3DtD7uGFB9ShwgmCJB5KmaQ==}
-    engines: {node: ^18.18.0 || >=20.0.0}
+  '@typescript-eslint/eslint-plugin@8.0.0-alpha.23':
+    resolution: {integrity: sha512-1RvVA8dcAcVo3yco4OGuxWQhlMSmRSz5+8kQnM6mhexbhOlRYUdfokdkJEMFjdN+if3TdlLmZHqvWKTRXkFcLw==}
+    engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
     peerDependencies:
-      '@typescript-eslint/parser': ^7.0.0
-      eslint: ^8.56.0
+      '@typescript-eslint/parser': ^8.0.0 || ^8.0.0-alpha.0
+      eslint: ^8.57.0 || ^9.0.0
       typescript: '*'
     peerDependenciesMeta:
       typescript:
         optional: true
 
-  '@typescript-eslint/parser@7.11.0':
-    resolution: {integrity: sha512-yimw99teuaXVWsBcPO1Ais02kwJ1jmNA1KxE7ng0aT7ndr1pT1wqj0OJnsYVGKKlc4QJai86l/025L6z8CljOg==}
-    engines: {node: ^18.18.0 || >=20.0.0}
+  '@typescript-eslint/parser@8.0.0-alpha.23':
+    resolution: {integrity: sha512-vy1+uoRoRNbgeo9up2xT6FZO8gVkTHQVgqEAek4UgFlGq7v5FcXexB5krKT6nuVOkMCKf47R9C6DlPqA8lmCAg==}
+    engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
     peerDependencies:
-      eslint: ^8.56.0
+      eslint: ^8.57.0 || ^9.0.0
       typescript: '*'
     peerDependenciesMeta:
       typescript:
         optional: true
 
-  '@typescript-eslint/scope-manager@7.11.0':
-    resolution: {integrity: sha512-27tGdVEiutD4POirLZX4YzT180vevUURJl4wJGmm6TrQoiYwuxTIY98PBp6L2oN+JQxzE0URvYlzJaBHIekXAw==}
-    engines: {node: ^18.18.0 || >=20.0.0}
+  '@typescript-eslint/scope-manager@6.21.0':
+    resolution: {integrity: sha512-OwLUIWZJry80O99zvqXVEioyniJMa+d2GrqpUTqi5/v5D5rOrppJVBPa0yKCblcigC0/aYAzxxqQ1B+DS2RYsg==}
+    engines: {node: ^16.0.0 || >=18.0.0}
 
-  '@typescript-eslint/type-utils@7.11.0':
-    resolution: {integrity: sha512-WmppUEgYy+y1NTseNMJ6mCFxt03/7jTOy08bcg7bxJJdsM4nuhnchyBbE8vryveaJUf62noH7LodPSo5Z0WUCg==}
-    engines: {node: ^18.18.0 || >=20.0.0}
+  '@typescript-eslint/scope-manager@8.0.0-alpha.23':
+    resolution: {integrity: sha512-36uBn77nnUUCiZZCyQwl0hBjyQv1euVrd0INMDSCv3RxqfB4A9tyzR1GeckJjAYffFCqV5cplXvdAbEJLlHQug==}
+    engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
+
+  '@typescript-eslint/type-utils@8.0.0-alpha.23':
+    resolution: {integrity: sha512-8Lnp882Bu3ObhadKZmG4XJlY0LTBk1NOWJs4V9YVEDxLCDxVPxSKy2TGmiKlGyMGZyJGBNPlS9+NwODWln79og==}
+    engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
     peerDependencies:
-      eslint: ^8.56.0
       typescript: '*'
     peerDependenciesMeta:
       typescript:
         optional: true
 
+  '@typescript-eslint/types@6.21.0':
+    resolution: {integrity: sha512-1kFmZ1rOm5epu9NZEZm1kckCDGj5UJEf7P1kliH4LKu/RkwpsfqqGmY2OOcUs18lSlQBKLDYBOGxRVtrMN5lpg==}
+    engines: {node: ^16.0.0 || >=18.0.0}
+
   '@typescript-eslint/types@7.11.0':
     resolution: {integrity: sha512-MPEsDRZTyCiXkD4vd3zywDCifi7tatc4K37KqTprCvaXptP7Xlpdw0NR2hRJTetG5TxbWDB79Ys4kLmHliEo/w==}
     engines: {node: ^18.18.0 || >=20.0.0}
 
-  '@typescript-eslint/typescript-estree@7.11.0':
-    resolution: {integrity: sha512-cxkhZ2C/iyi3/6U9EPc5y+a6csqHItndvN/CzbNXTNrsC3/ASoYQZEt9uMaEp+xFNjasqQyszp5TumAVKKvJeQ==}
-    engines: {node: ^18.18.0 || >=20.0.0}
+  '@typescript-eslint/types@8.0.0-alpha.23':
+    resolution: {integrity: sha512-WU8CewNsW4mPNt4qXaUwqq8WOwI9Ee7CKrMxjHH70v/B0ssiUFdUI8DebJeFUp6snoAdVbeB5yaUJx5iqE9q8w==}
+    engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
+
+  '@typescript-eslint/typescript-estree@6.21.0':
+    resolution: {integrity: sha512-6npJTkZcO+y2/kr+z0hc4HwNfrrP4kNYh57ek7yCNlrBjWQ1Y0OS7jiZTkgumrvkX5HkEKXFZkkdFNkaW2wmUQ==}
+    engines: {node: ^16.0.0 || >=18.0.0}
     peerDependencies:
       typescript: '*'
     peerDependenciesMeta:
       typescript:
         optional: true
 
-  '@typescript-eslint/utils@7.11.0':
-    resolution: {integrity: sha512-xlAWwPleNRHwF37AhrZurOxA1wyXowW4PqVXZVUNCLjB48CqdPJoJWkrpH2nij9Q3Lb7rtWindtoXwxjxlKKCA==}
-    engines: {node: ^18.18.0 || >=20.0.0}
+  '@typescript-eslint/typescript-estree@8.0.0-alpha.23':
+    resolution: {integrity: sha512-pGW2Kbn0GGFJDcH9SoZV3U6Ji9E1wlV+vOdMYaAdcowpS+27cjx/esuVez4+c67cZKz6giUdHSVlnUkxFXg0AQ==}
+    engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
+    peerDependencies:
+      typescript: '*'
+    peerDependenciesMeta:
+      typescript:
+        optional: true
+
+  '@typescript-eslint/utils@6.21.0':
+    resolution: {integrity: sha512-NfWVaC8HP9T8cbKQxHcsJBY5YE1O33+jpMwN45qzWWaPDZgLIbo12toGMWnmhvCpd3sIxkpDw3Wv1B3dYrbDQQ==}
+    engines: {node: ^16.0.0 || >=18.0.0}
     peerDependencies:
-      eslint: ^8.56.0
+      eslint: ^7.0.0 || ^8.0.0
 
-  '@typescript-eslint/visitor-keys@7.11.0':
-    resolution: {integrity: sha512-7syYk4MzjxTEk0g/w3iqtgxnFQspDJfn6QKD36xMuuhTzjcxY7F8EmBLnALjVyaOF1/bVocu3bS/2/F7rXrveQ==}
-    engines: {node: ^18.18.0 || >=20.0.0}
+  '@typescript-eslint/utils@8.0.0-alpha.23':
+    resolution: {integrity: sha512-xSC5+fE/WxYdXJSow3wyJawTKTc3oZonDyH0o/k5da+r171iWFhiUkayK0zQDScEP83VpgkSuwThMUwm9Htkdg==}
+    engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
+    peerDependencies:
+      eslint: ^8.57.0 || ^9.0.0
 
-  '@ungap/structured-clone@1.2.0':
-    resolution: {integrity: sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==}
+  '@typescript-eslint/visitor-keys@6.21.0':
+    resolution: {integrity: sha512-JJtkDduxLi9bivAB+cYOVMtbkqdPOhZ+ZI5LC47MIRrDV4Yn2o+ZnW10Nkmr28xRpSpdJ6Sm42Hjf2+REYXm0A==}
+    engines: {node: ^16.0.0 || >=18.0.0}
+
+  '@typescript-eslint/visitor-keys@8.0.0-alpha.23':
+    resolution: {integrity: sha512-7TGJ++lEfwtsOciFIBDtkDyLMQJMApbam8ErbEHFTBB2En63LOmuBISXLUimLJ+O1WnTP8jf8bixlyrMTzaY7g==}
+    engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
 
   JSONStream@1.3.5:
     resolution: {integrity: sha512-E+iruNOY8VV9s4JEbe1aNEm6MiszPRr/UfcHMz0TQh1BXSxHK+ASV1R6W4HpjBhSeS+54PIsAMCBmwD06LLsqQ==}
@@ -721,9 +957,6 @@ packages:
   ajv@6.12.6:
     resolution: {integrity: sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==}
 
-  ajv@8.12.0:
-    resolution: {integrity: sha512-sRu1kpcO9yLtYxBKvqfTeh9KzZEwO3STyX1HT+4CaDzC6HpTGYhIhPIzj9XuKU7KYDwnaeh5hcOwjy1QuJzBPA==}
-
   ajv@8.14.0:
     resolution: {integrity: sha512-oYs1UUtO97ZO2lJ4bwnWeQW8/zvOIQLGKcvPTsWmvc2SYgBb+upuNS5NxoLaMU4h8Ju3Nbj6Cq8mD2LQoqVKFA==}
 
@@ -787,26 +1020,13 @@ packages:
   array-ify@1.0.0:
     resolution: {integrity: sha512-c5AMf34bKdvPhQ7tBGhqkgKNUzMr4WUs+WDtC2ZUGOUncbxKMTvqxYctiseW3+L4bA8ec+GcZ6/A/FW4m8ukng==}
 
-  array-includes@3.1.8:
-    resolution: {integrity: sha512-itaWrbYbqpGXkGhZPGUulwnhVf5Hpy1xiCFsGqyIGglbBxmG5vSjxQen3/WGOjPpNEv1RtBLKxbmVXm8HpJStQ==}
-    engines: {node: '>= 0.4'}
+  array-timsort@1.0.3:
+    resolution: {integrity: sha512-/+3GRL7dDAGEfM6TseQk/U+mi18TU2Ms9I3UlLdUMhz2hbvGNTKdj9xniwXfUqgYhHxRx0+8UnKkvlNwVU+cWQ==}
 
   array-union@2.1.0:
     resolution: {integrity: sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==}
     engines: {node: '>=8'}
 
-  array.prototype.findlastindex@1.2.5:
-    resolution: {integrity: sha512-zfETvRFA8o7EiNn++N5f/kaCw221hrpGsDmcpndVupkPzEc1Wuf3VgC0qby1BbHs7f5DVYjgtEU2LLh5bqeGfQ==}
-    engines: {node: '>= 0.4'}
-
-  array.prototype.flat@1.3.2:
-    resolution: {integrity: sha512-djYB+Zx2vLewY8RWlNCUdHjDXs2XOgm602S9E7P/UpHgfeHL00cRiIF+IN/G/aUJ7kGPb6yO/ErDI5V2s8iycA==}
-    engines: {node: '>= 0.4'}
-
-  array.prototype.flatmap@1.3.2:
-    resolution: {integrity: sha512-Ewyx0c9PmpcsByhSW4r+9zDU7sGjFc86qf/kKtuSCRdhfbk0SNLLkaT5qvcHnRGgc5NP/ly/y+qkXkqONX54CQ==}
-    engines: {node: '>= 0.4'}
-
   array.prototype.map@1.0.7:
     resolution: {integrity: sha512-XpcFfLoBEAhezrrNw1V+yLXkE7M6uR7xJEsxbG6c/V9v043qurwVJB9r9UTnoSioFDoz1i1VOydpWGmJpfVZbg==}
     engines: {node: '>= 0.4'}
@@ -929,6 +1149,10 @@ packages:
     resolution: {integrity: sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==}
     engines: {node: '>=6'}
 
+  clear-module@4.1.2:
+    resolution: {integrity: sha512-LWAxzHqdHsAZlPlEyJ2Poz6AIs384mPeqLVCru2p0BrP9G/kVGuhNyZYClLO6cXlnuJjzC8xtsJIuMjKqLXoAw==}
+    engines: {node: '>=8'}
+
   cli-boxes@3.0.0:
     resolution: {integrity: sha512-/lzGpEWL/8PfI0BmBOPRwp0c/wFNX1RdUML3jK/RcSBA9T8mZDdQpqYBKtCFTOfQbwPqWEOpjqW+Fnayc0969g==}
     engines: {node: '>=10'}
@@ -987,6 +1211,10 @@ packages:
   commander@2.20.3:
     resolution: {integrity: sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==}
 
+  comment-json@4.2.3:
+    resolution: {integrity: sha512-SsxdiOf064DWoZLH799Ata6u7iV658A11PlWtZATDlXPpKGJnbJZ5Z24ybixAi+LUUqJ/GKowAejtC5GFUG7Tw==}
+    engines: {node: '>= 6'}
+
   comment-parser@1.4.1:
     resolution: {integrity: sha512-buhp5kePrmda3vhc5B9t7pUQXAb2Tnd0qgpkIhPhkHXxJpiPJ11H0ZEU0oBpJ2QztSbzG/ZxMj/CHsYJqRHmyg==}
     engines: {node: '>= 12.0.0'}
@@ -1020,6 +1248,9 @@ packages:
   convert-source-map@2.0.0:
     resolution: {integrity: sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==}
 
+  core-util-is@1.0.3:
+    resolution: {integrity: sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==}
+
   cosmiconfig-typescript-loader@5.0.0:
     resolution: {integrity: sha512-+8cK7jRAReYkMwMiG+bxhcNKiHJDM6bR9FD/nGBXOWdMLuYawjF5cGrtLilJ+LGd3ZjCXnJjR5DkfWPoIVlqJA==}
     engines: {node: '>=v16'}
@@ -1050,6 +1281,35 @@ packages:
     resolution: {integrity: sha512-x8dy3RnvYdlUcPOjkEHqozhiwzKNSq7GcPuXFbnyMOCHxX8V3OgIg/pYuabl2sbUPfIJaeAQB7PMOK8DFIdoRA==}
     engines: {node: '>=12'}
 
+  cspell-config-lib@8.8.3:
+    resolution: {integrity: sha512-61NKZrzTi9OLEEiZBggLQy9nswgR0gd6bKH06xXFQyRfNpAjaPOzOUFhSSfX1MQX+lQF3KtSYcHpppwbpPsL8w==}
+    engines: {node: '>=18'}
+
+  cspell-dictionary@8.8.3:
+    resolution: {integrity: sha512-g2G3uh8JbuJKAYFdFQENcbTIrK9SJRXBiQ/t+ch+9I/t5HmuGOVe+wxKEM/0c9M2CRLpzJShBvttH9rnw4Yqfg==}
+    engines: {node: '>=18'}
+
+  cspell-glob@8.8.3:
+    resolution: {integrity: sha512-9c4Nw/bIsjKSuBuRrLa1sWtIzbXXvja+FVbUOE9c2IiZfh6K1I+UssiXTbRTMg6qgTdkfT4o3KOcFN0ZcbmCUQ==}
+    engines: {node: '>=18'}
+
+  cspell-grammar@8.8.3:
+    resolution: {integrity: sha512-3RP7xQ/6IiIjbWQDuE+4b0ERKkSWGMY75bd0oEsh5HcFhhOYphmcpxLxRRM/yxYQaYgdvq0QIcwrpanx86KJ7A==}
+    engines: {node: '>=18'}
+    hasBin: true
+
+  cspell-io@8.8.3:
+    resolution: {integrity: sha512-vO7BUa6i7tjmQr+9dw/Ic7tm4ECnSUlbuMv0zJs/SIrO9AcID2pCWPeZNZEGAmeutrEOi2iThZ/uS33aCuv7Jw==}
+    engines: {node: '>=18'}
+
+  cspell-lib@8.8.3:
+    resolution: {integrity: sha512-IqtTKBPug5Jzt9T8f/b6qGAbARRR5tpQkLjzsrfLzxM68ery23wEPDtmWToEyc9EslulZGLe0T78XuEU9AMF+g==}
+    engines: {node: '>=18'}
+
+  cspell-trie-lib@8.8.3:
+    resolution: {integrity: sha512-0zrkrhrFLVajwo6++XD9a+r0Olml7UjPgbztjPKbXIJrZCradBF5rvt3wq5mPpsjq2+Dz0z6K5muZpbO+gqapQ==}
+    engines: {node: '>=18'}
+
   dargs@8.1.0:
     resolution: {integrity: sha512-wAV9QHOsNbwnWdNW2FYvE1P56wtgSbM+3SZcdGiWQILwVjACCXDCI3Ai8QlCjMDB8YK5zySiXZYBiwGmNY3lnw==}
     engines: {node: '>=12'}
@@ -1077,14 +1337,6 @@ packages:
   dateformat@4.6.3:
     resolution: {integrity: sha512-2P0p0pFGzHS5EMnhdxQi7aJN+iMheud0UhG4dlE1DLAlvL8JHjJJTX/CSm4JXwV0Ka5nGk3zC5mcb5bUQUxxMA==}
 
-  debug@3.2.7:
-    resolution: {integrity: sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==}
-    peerDependencies:
-      supports-color: '*'
-    peerDependenciesMeta:
-      supports-color:
-        optional: true
-
   debug@4.3.4:
     resolution: {integrity: sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==}
     engines: {node: '>=6.0'}
@@ -1171,14 +1423,6 @@ packages:
     resolution: {integrity: sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==}
     engines: {node: '>=8'}
 
-  doctrine@2.1.0:
-    resolution: {integrity: sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==}
-    engines: {node: '>=0.10.0'}
-
-  doctrine@3.0.0:
-    resolution: {integrity: sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==}
-    engines: {node: '>=6.0.0'}
-
   dot-prop@5.3.0:
     resolution: {integrity: sha512-QM8q3zDe58hqUqjraQOmzZ1LIH9SWQJTlEKCH4kJ2oQvLZk7RbQXvtDM2XEq3fwkV9CCvvH4LA0AV+ogFsBM2Q==}
     engines: {node: '>=8'}
@@ -1207,6 +1451,10 @@ packages:
     resolution: {integrity: sha512-+h1lkLKhZMTYjog1VEpJNG7NZJWcuc2DDk/qsqSTRRCOXiLjeQ1d1/udrUGhqMxUgAlwKNZ0cf2uqan5GLuS2A==}
     engines: {node: '>=6'}
 
+  env-paths@3.0.0:
+    resolution: {integrity: sha512-dtJUTepzMW3Lm/NPxRf3wP4642UWhjL2sQxc+ym2YMj1m/H2zDNQOlezafzkHwn6sMstjHTwG6iQQsctDW/b1A==}
+    engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0}
+
   error-ex@1.3.2:
     resolution: {integrity: sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==}
 
@@ -1236,9 +1484,6 @@ packages:
     resolution: {integrity: sha512-3T8uNMC3OQTHkFUsFq8r/BwAXLHvU/9O9mE0fBc/MY5iq/8H7ncvO947LmYA6ldWw9Uh8Yhf25zu6n7nML5QWQ==}
     engines: {node: '>= 0.4'}
 
-  es-shim-unscopables@1.0.2:
-    resolution: {integrity: sha512-J3yBRXCzDu4ULnQwxyToo/OjdMx6akgVC7K6few0a7F/0wLtmKKN7I73AH5T2836UuXRqN7Qg+IIUw/+YJksRw==}
-
   es-to-primitive@1.2.1:
     resolution: {integrity: sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==}
     engines: {node: '>= 0.4'}
@@ -1277,76 +1522,16 @@ packages:
     peerDependencies:
       eslint: '>=6.0.0'
 
-  eslint-config-love@47.0.0:
-    resolution: {integrity: sha512-wIeJhb4/NF7nE5Ltppg1e9dp1Auxx0+ZPRysrXQ3uBKlW4Nj/UiTZu4r3sKWCxo6HGcRcI4MC1Q5421y3fny2w==}
-    peerDependencies:
-      '@typescript-eslint/eslint-plugin': ^7.0.1
-      eslint: ^8.0.1
-      eslint-plugin-import: ^2.25.2
-      eslint-plugin-n: '^15.0.0 || ^16.0.0 '
-      eslint-plugin-promise: ^6.0.0
-      typescript: '*'
-
-  eslint-config-standard@17.1.0:
-    resolution: {integrity: sha512-IwHwmaBNtDK4zDHQukFDW5u/aTb8+meQWZvNFWkiGmbWjD6bqyuSSBxxXKkCftCUzc1zwCH2m/baCNDLGmuO5Q==}
-    engines: {node: '>=12.0.0'}
-    peerDependencies:
-      eslint: ^8.0.1
-      eslint-plugin-import: ^2.25.2
-      eslint-plugin-n: '^15.0.0 || ^16.0.0 '
-      eslint-plugin-promise: ^6.0.0
-
   eslint-define-config@2.1.0:
     resolution: {integrity: sha512-QUp6pM9pjKEVannNAbSJNeRuYwW3LshejfyBBpjeMGaJjaDUpVps4C6KVR8R7dWZnD3i0synmrE36znjTkJvdQ==}
     engines: {node: '>=18.0.0', npm: '>=9.0.0', pnpm: '>=8.6.0'}
 
-  eslint-import-resolver-node@0.3.9:
-    resolution: {integrity: sha512-WFj2isz22JahUv+B788TlO3N6zL3nNJGU8CcZbPZvVEkBPaJdCV4vy5wyghty5ROFbCRnm132v8BScu5/1BQ8g==}
-
-  eslint-import-resolver-typescript@3.6.1:
-    resolution: {integrity: sha512-xgdptdoi5W3niYeuQxKmzVDTATvLYqhpwmykwsh7f6HIOStGWEIL9iqZgQDF9u9OEzrRwR8no5q2VT+bjAujTg==}
-    engines: {node: ^14.18.0 || >=16.0.0}
-    peerDependencies:
-      eslint: '*'
-      eslint-plugin-import: '*'
-
-  eslint-module-utils@2.8.1:
-    resolution: {integrity: sha512-rXDXR3h7cs7dy9RNpUlQf80nX31XWJEyGq1tRMo+6GsO5VmTe4UTwtmonAD4ZkAsrfMVDA2wlGJ3790Ys+D49Q==}
-    engines: {node: '>=4'}
-    peerDependencies:
-      '@typescript-eslint/parser': '*'
-      eslint: '*'
-      eslint-import-resolver-node: '*'
-      eslint-import-resolver-typescript: '*'
-      eslint-import-resolver-webpack: '*'
-    peerDependenciesMeta:
-      '@typescript-eslint/parser':
-        optional: true
-      eslint:
-        optional: true
-      eslint-import-resolver-node:
-        optional: true
-      eslint-import-resolver-typescript:
-        optional: true
-      eslint-import-resolver-webpack:
-        optional: true
-
   eslint-plugin-es-x@7.6.0:
     resolution: {integrity: sha512-I0AmeNgevgaTR7y2lrVCJmGYF0rjoznpDvqV/kIkZSZbZ8Rw3eu4cGlvBBULScfkSOCzqKbff5LR4CNrV7mZHA==}
     engines: {node: ^14.18.0 || >=16.0.0}
     peerDependencies:
       eslint: '>=8'
 
-  eslint-plugin-import@2.29.1:
-    resolution: {integrity: sha512-BbPC0cuExzhiMo4Ff1BTVwHpjjv28C5R+btTOGaCRC7UEz801up0JadwkeSk5Ued6TG34uaczuVuH6qyy5YUxw==}
-    engines: {node: '>=4'}
-    peerDependencies:
-      '@typescript-eslint/parser': '*'
-      eslint: ^2 || ^3 || ^4 || ^5 || ^6 || ^7.2.0 || ^8
-    peerDependenciesMeta:
-      '@typescript-eslint/parser':
-        optional: true
-
   eslint-plugin-jsdoc@48.2.7:
     resolution: {integrity: sha512-fYj3roTnkFL9OFFTB129rico8lerC5G8Vp2ZW9SjO9RNWG0exVvI+i/Y8Bpm1ufjR0uvT38xtoab/U0Hp8Ybog==}
     engines: {node: '>=18'}
@@ -1359,38 +1544,32 @@ packages:
     peerDependencies:
       eslint: '>=8.23.0'
 
-  eslint-plugin-promise@6.2.0:
-    resolution: {integrity: sha512-QmAqwizauvnKOlifxyDj2ObfULpHQawlg/zQdgEixur9vl0CvZGv/LCJV2rtj3210QCoeGBzVMfMXqGAOr/4fA==}
-    engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
-    peerDependencies:
-      eslint: ^7.0.0 || ^8.0.0 || ^9.0.0
-
   eslint-plugin-simple-import-sort@12.1.0:
     resolution: {integrity: sha512-Y2fqAfC11TcG/WP3TrI1Gi3p3nc8XJyEOJYHyEPEGI/UAgNx6akxxlX74p7SbAQdLcgASKhj8M0GKvH3vq/+ig==}
     peerDependencies:
       eslint: '>=5.0.0'
 
-  eslint-plugin-spellcheck@0.0.20:
-    resolution: {integrity: sha512-GJa6vgzWAYqe0elKADAsiBRrhvqBnKyt7tpFSqlCZJsK2W9+K80oMyHhKolA7vJ13H5RCGs5/KCN+mKUyKoAiA==}
-    peerDependencies:
-      eslint: '>=0.8.0'
-
-  eslint-plugin-tsdoc@0.3.0:
-    resolution: {integrity: sha512-0MuFdBrrJVBjT/gyhkP2BqpD0np1NxNLfQ38xXDlSs/KVVpKI2A6vN7jx2Rve/CyUsvOsMGwp9KKrinv7q9g3A==}
-
-  eslint-scope@7.2.2:
-    resolution: {integrity: sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg==}
-    engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
+  eslint-scope@8.0.1:
+    resolution: {integrity: sha512-pL8XjgP4ZOmmwfFE8mEhSxA7ZY4C+LWyqjQ3o4yWkkmD0qcMT9kkW3zWHOczhWcjTSgqycYAgwSlXvZltv65og==}
+    engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
 
   eslint-visitor-keys@3.4.3:
     resolution: {integrity: sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==}
     engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
 
-  eslint@8.57.0:
-    resolution: {integrity: sha512-dZ6+mexnaTIbSBZWgou51U6OmzIhYM2VcNdtiTtI7qPNZm35Akpr0f6vtw3w1Kmn5PYo+tZVfh13WrhpS6oLqQ==}
-    engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
+  eslint-visitor-keys@4.0.0:
+    resolution: {integrity: sha512-OtIRv/2GyiF6o/d8K7MYKKbXrOUBIK6SfkIRM4Z0dY3w+LiQ0vy3F57m0Z71bjbyeiWFiHJ8brqnmE6H6/jEuw==}
+    engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
+
+  eslint@9.3.0:
+    resolution: {integrity: sha512-5Iv4CsZW030lpUqHBapdPo3MJetAPtejVW8B84GIcIIv8+ohFaddXsrn1Gn8uD9ijDb+kcYKFUVmC8qG8B2ORQ==}
+    engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
     hasBin: true
 
+  espree@10.0.1:
+    resolution: {integrity: sha512-MWkrWZbJsL2UwnjxTX3gG8FneachS/Mwg7tdGXce011sJd5b0JG54vat5KHnfSBODZ3Wvzd2WnjxyzsRoVv+ww==}
+    engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
+
   espree@9.6.1:
     resolution: {integrity: sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==}
     engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
@@ -1415,6 +1594,9 @@ packages:
   estree-walker@2.0.2:
     resolution: {integrity: sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==}
 
+  estree-walker@3.0.3:
+    resolution: {integrity: sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==}
+
   esutils@2.0.3:
     resolution: {integrity: sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==}
     engines: {node: '>=0.10.0'}
@@ -1441,6 +1623,10 @@ packages:
   fast-deep-equal@3.1.3:
     resolution: {integrity: sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==}
 
+  fast-equals@5.0.1:
+    resolution: {integrity: sha512-WF1Wi8PwwSY7/6Kx0vKXtw8RwuSGoM1bvDaJbu7MxDlR1vovZjIAKrnzyrThgAjm6JDTu0fVgWXDlMGspodfoQ==}
+    engines: {node: '>=6.0.0'}
+
   fast-glob@3.3.2:
     resolution: {integrity: sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==}
     engines: {node: '>=8.6.0'}
@@ -1458,9 +1644,9 @@ packages:
     resolution: {integrity: sha512-7yAQpD2UMJzLi1Dqv7qFYnPbaPx7ZfFK6PiIxQ4PfkGPyNyl2Ugx+a/umUonmKqjhM4DnfbMvdX6otXq83soQQ==}
     engines: {node: ^12.20 || >= 14.13}
 
-  file-entry-cache@6.0.1:
-    resolution: {integrity: sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==}
-    engines: {node: ^10.12.0 || >=12.0.0}
+  file-entry-cache@8.0.0:
+    resolution: {integrity: sha512-XXTUwCvisa5oacNGRP9SfNtYBNAMi+RPwBFmblZEF7N7swHYQS6/Zfk7SRwx4D5j3CH211YNRco1DEMNVfZCnQ==}
+    engines: {node: '>=16.0.0'}
 
   fill-range@7.1.1:
     resolution: {integrity: sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==}
@@ -1474,9 +1660,9 @@ packages:
     resolution: {integrity: sha512-YyZM99iHrqLKjmt4LJDj58KI+fYyufRLBSYcqycxf//KpBk9FoewoGX0450m9nB44qrZnovzC2oeP5hUibxc/g==}
     engines: {node: '>=18'}
 
-  flat-cache@3.2.0:
-    resolution: {integrity: sha512-CYcENa+FtcUKLmhhqyctpclsq7QF38pKjZHsGNiSQF5r4FtoKDWabFDl3hzaEQMvT1LHEysw5twgLvpYYb4vbw==}
-    engines: {node: ^10.12.0 || >=12.0.0}
+  flat-cache@4.0.1:
+    resolution: {integrity: sha512-f7ccFPK3SXFHpx15UIGyRJ/FJQctuKZ0zVuN3frBo4HnK3cay9VEW0R6yPYFHC0AgqhukPzKjq22t5DmAyqGyw==}
+    engines: {node: '>=16'}
 
   flat@5.0.2:
     resolution: {integrity: sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ==}
@@ -1529,6 +1715,10 @@ packages:
   functions-have-names@1.2.3:
     resolution: {integrity: sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==}
 
+  gensequence@7.0.0:
+    resolution: {integrity: sha512-47Frx13aZh01afHJTB3zTtKIlFI6vWY+MYCN9Qpew6i52rfKjnhCF/l1YlC8UmEMvvntZZ6z4PiCcmyuedR2aQ==}
+    engines: {node: '>=18'}
+
   get-caller-file@2.0.5:
     resolution: {integrity: sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==}
     engines: {node: 6.* || 8.* || >= 10.*}
@@ -1596,9 +1786,9 @@ packages:
     resolution: {integrity: sha512-NBcGGFbBA9s1VzD41QXDG+3++t9Mn5t1FpLdhESY6oKY4gYTFpX4wO3sqGUa0Srjtbfj3szX0RnemmrVRUdULA==}
     engines: {node: '>=10'}
 
-  globals@13.24.0:
-    resolution: {integrity: sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==}
-    engines: {node: '>=8'}
+  globals@14.0.0:
+    resolution: {integrity: sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ==}
+    engines: {node: '>=18'}
 
   globals@15.3.0:
     resolution: {integrity: sha512-cCdyVjIUVTtX8ZsPkq1oCsOsLmGIswqnjZYMJJTGaNApj1yHtLSymKhwH51ttirREn75z3p4k051clwg7rvNKA==}
@@ -1651,6 +1841,10 @@ packages:
     resolution: {integrity: sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==}
     engines: {node: '>=8'}
 
+  has-own-prop@2.0.0:
+    resolution: {integrity: sha512-Pq0h+hvsVm6dDEa8x82GnLSYHOzNDt7f0ddFa3FqcQlgzEiptPqL+XrOJNavjOzSYiYWIrgeVYYgGlLmnxwilQ==}
+    engines: {node: '>=8'}
+
   has-property-descriptors@1.0.2:
     resolution: {integrity: sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==}
 
@@ -1700,10 +1894,6 @@ packages:
     resolution: {integrity: sha512-AXcZb6vzzrFAUE61HnN4mpLqd/cSIwNQjtNWR0euPm6y0iqx3G4gOXaIDdtdDwZmhwe82LA6+zinmW4UBWVePQ==}
     engines: {node: '>=16.17.0'}
 
-  hunspell-spellchecker@1.0.2:
-    resolution: {integrity: sha512-4DwmFAvlz+ChsqLDsZT2cwBsYNXh+oWboemxXtafwKIyItq52xfR4e4kr017sLAoPaSYVofSOvPUfmOAhXyYvw==}
-    hasBin: true
-
   husky@9.0.11:
     resolution: {integrity: sha512-AB6lFlbwwyIqMdHYhwPe+kjOC3Oc5P3nThEoW/AaO2BX3vJDjWPFxYLxokUZOo6RNX20He3AaT8sESs9NJcmEw==}
     engines: {node: '>=18'}
@@ -2014,9 +2204,6 @@ packages:
     resolution: {integrity: sha512-gFqAIbuKyyso/3G2qhiO2OM6shY6EPP/R0+mkDbyspxKazh8BXDC5FiFsUjlczgdNz/vfra0da2y+aHrusLG/Q==}
     hasBin: true
 
-  jju@1.4.0:
-    resolution: {integrity: sha512-8wb9Yw966OSxApiCt0K3yNJL8pnNeIv+OEq2YMidz4FKP6nonSRoOXc80iXY4JaN2FC11B9qsNmDsm+ZOfMROA==}
-
   js-tokens@4.0.0:
     resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==}
 
@@ -2049,10 +2236,6 @@ packages:
   json-stringify-safe@5.0.1:
     resolution: {integrity: sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA==}
 
-  json5@1.0.2:
-    resolution: {integrity: sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA==}
-    hasBin: true
-
   jsonc-parser@3.2.1:
     resolution: {integrity: sha512-AilxAyFOAcK5wA1+LeaySVBrHsGQvUFCDWXKpZjzaL0PqW+xfBOttn8GNtWKFWqneyMZj41MWF9Kl6iPWLwgOA==}
 
@@ -2247,6 +2430,10 @@ packages:
     resolution: {integrity: sha512-nLDxIFRyhDblz3qMuq+SoRZED4+miJ/G+tdDrjkkkRnjAsBexeGpgjLEQ0blJy7rHhR2b93rhQY4SvyWu9v03g==}
     engines: {node: '>=10'}
 
+  minimatch@9.0.3:
+    resolution: {integrity: sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==}
+    engines: {node: '>=16 || 14 >=14.17'}
+
   minimatch@9.0.4:
     resolution: {integrity: sha512-KqWh+VchfxcMNRAJjj2tnsSJdNbHsVgnkBhTNrW7AjVo6OvLtxw8zfT9oLw1JSohlFzJ8jCoTgaoXvJ+kHt6fw==}
     engines: {node: '>=16 || 14 >=14.17'}
@@ -2281,6 +2468,13 @@ packages:
   natural-compare@1.4.0:
     resolution: {integrity: sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==}
 
+  neostandard@0.5.1:
+    resolution: {integrity: sha512-PaeGRlEyc0EQ0a5ORPZurasGhjfdgFB2TLGyTAnl7Vj1xerZ3vgT5NFdbaVAb1PtoT/HOFtOajYAUguNl9hDew==}
+    engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
+    hasBin: true
+    peerDependencies:
+      eslint: ^9.0.0
+
   netmask@2.0.2:
     resolution: {integrity: sha512-dBpDMdxv9Irdq66304OLfEmQ9tbNRFnFTuZiLo+bD+r332bBmMJ8GBLXklIXXgxd3+v9+KUnZaUR5PJMa75Gsg==}
     engines: {node: '>= 0.4.0'}
@@ -2331,18 +2525,6 @@ packages:
     resolution: {integrity: sha512-byy+U7gp+FVwmyzKPYhW2h5l3crpmGsxl7X2s8y43IgxvG4g3QZ6CffDtsNQy1WsmZpQbO+ybo0AlW7TY6DcBQ==}
     engines: {node: '>= 0.4'}
 
-  object.fromentries@2.0.8:
-    resolution: {integrity: sha512-k6E21FzySsSK5a21KRADBd/NGneRegFO5pLHfdQLpRDETUNJueLXs3WCzyQ3tFRDYgbq3KHGXfTbi2bs8WQ6rQ==}
-    engines: {node: '>= 0.4'}
-
-  object.groupby@1.0.3:
-    resolution: {integrity: sha512-+Lhy3TQTuzXI5hevh8sBGqbmurHbbIjAi0Z4S63nthVLmLxfbj4T54a4CfZrXIrt9iP4mVAPYMo/v99taj3wjQ==}
-    engines: {node: '>= 0.4'}
-
-  object.values@1.2.0:
-    resolution: {integrity: sha512-yBYjY9QX2hnRmZHAjG/f13MzmBzxzYgQhFrke06TTyKY5zSTEqkOeukBzIdVA3j3ulu8Qa3MbVFShV7T2RmGtQ==}
-    engines: {node: '>= 0.4'}
-
   once@1.4.0:
     resolution: {integrity: sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==}
 
@@ -2422,6 +2604,10 @@ packages:
     resolution: {integrity: sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==}
     engines: {node: '>=6'}
 
+  parent-module@2.0.0:
+    resolution: {integrity: sha512-uo0Z9JJeWzv8BG+tRcapBKNJ0dro9cLyczGzulS6EfeyAdeC9sbojtW6XwvYxJkEne9En+J2XEl4zyglVeIwFg==}
+    engines: {node: '>=8'}
+
   parse-json@5.2.0:
     resolution: {integrity: sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==}
     engines: {node: '>=8'}
@@ -2466,6 +2652,10 @@ packages:
     resolution: {integrity: sha512-5HviZNaZcfqP95rwpv+1HDgUamezbqdSYTyzjTvwtJSnIH+3vnbmWsItli8OFEndS984VT55M3jduxZbX351gg==}
     engines: {node: '>=12'}
 
+  peowly@1.3.0:
+    resolution: {integrity: sha512-Tvj2QMNEuvL3WmaG4agZ6IGjOLGcvQSQO9TBJFkh9op+tNX3/J3UZtxPQWUA+d+Lki4u8WaNJ0OUwNt1G3GnWg==}
+    engines: {node: '>=18.6.0'}
+
   picocolors@1.0.1:
     resolution: {integrity: sha512-anP1Z8qwhkbmu7MFP5iTt+wQKXgwzf7zTyGlcdzabySa9vd0Xt392U0rVmz9poOaBj0uHJKyyo9/upk0HrEQew==}
 
@@ -2473,6 +2663,10 @@ packages:
     resolution: {integrity: sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==}
     engines: {node: '>=8.6'}
 
+  picomatch@4.0.2:
+    resolution: {integrity: sha512-M7BAV6Rlcy5u+m6oPhAPFgJTzAioX/6B0DxyvDlo9l8+T3nLKbrczg2WLUyzd45L8RqfUMyGPzekbMvX2Ldkwg==}
+    engines: {node: '>=12'}
+
   pidtree@0.6.0:
     resolution: {integrity: sha512-eG2dWTVw5bzqGRztnHExczNxt5VGsE6OwTeCG3fdUf9KBsZzO3R5OIIIzWR+iZA0NtZ+RDVdaoE2dK1cn6jH4g==}
     engines: {node: '>=0.10'}
@@ -2572,6 +2766,10 @@ packages:
     engines: {node: ^18.18.0 || ^20.8.0 || ^22.0.0}
     hasBin: true
 
+  repeat-string@1.6.1:
+    resolution: {integrity: sha512-PV0dzCYDNfRi1jCDbJzpW7jNNDRuCOG/jI5ctQcGKt/clZD+YcPS3yIlWuTJMmESC8aevCFmWJy5wjAFgNqN6w==}
+    engines: {node: '>=0.10'}
+
   require-directory@2.1.1:
     resolution: {integrity: sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==}
     engines: {node: '>=0.10.0'}
@@ -2837,10 +3035,6 @@ packages:
     resolution: {integrity: sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==}
     engines: {node: '>=12'}
 
-  strip-bom@3.0.0:
-    resolution: {integrity: sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==}
-    engines: {node: '>=4'}
-
   strip-final-newline@2.0.0:
     resolution: {integrity: sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==}
     engines: {node: '>=6'}
@@ -2873,6 +3067,10 @@ packages:
     resolution: {integrity: sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==}
     engines: {node: '>= 0.4'}
 
+  synckit@0.9.0:
+    resolution: {integrity: sha512-7RnqIMq572L8PeEzKeBINYEJDDxpcH8JEgLwUqBd3TkofhFRbkq4QLR0u+36avGAhCRbk2nnmjcW9SE531hPDg==}
+    engines: {node: ^14.18.0 || >=16.0.0}
+
   tapable@2.2.1:
     resolution: {integrity: sha512-GNzQvQTOIP6RyTfE2Qxb8ZVlNmw0n88vp1szwWRimP02mnTsx3Wtn5qRdqY9w2XduFNUgvOwhNnQsjwCp+kqaQ==}
     engines: {node: '>=6'}
@@ -2921,9 +3119,6 @@ packages:
     peerDependencies:
       typescript: '>=4.2.0'
 
-  tsconfig-paths@3.15.0:
-    resolution: {integrity: sha512-2Ac2RgzDe/cn48GvOe3M+o82pEFewD3UPbyoUHHdKasHwJKjds4fLXWf/Ux5kATBKN20oaFGu+jbElp1pos0mg==}
-
   tslib@2.6.2:
     resolution: {integrity: sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==}
 
@@ -2935,10 +3130,6 @@ packages:
     resolution: {integrity: sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==}
     engines: {node: '>=4'}
 
-  type-fest@0.20.2:
-    resolution: {integrity: sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==}
-    engines: {node: '>=10'}
-
   type-fest@0.21.3:
     resolution: {integrity: sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==}
     engines: {node: '>=10'}
@@ -2977,6 +3168,15 @@ packages:
     peerDependencies:
       typescript: 4.6.x || 4.7.x || 4.8.x || 4.9.x || 5.0.x || 5.1.x || 5.2.x || 5.3.x || 5.4.x
 
+  typescript-eslint@8.0.0-alpha.23:
+    resolution: {integrity: sha512-9z27xLf8JrrUZKZxHYfKuuw0WWroQ+iOg53EMzBJTr16RrNYMUA5rE4QMZm3J80OTQV2MByLAIN9WnDlNLxLgQ==}
+    engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
+    peerDependencies:
+      typescript: '*'
+    peerDependenciesMeta:
+      typescript:
+        optional: true
+
   typescript@5.4.5:
     resolution: {integrity: sha512-vcI4UpRgg81oIRUFwR0WSIHKt11nJ7SAVlYNIu+QpqeyXP+gpQJy/Z4+F0aGxSE4MqwjyXvW/TzgkLAx2AGHwQ==}
     engines: {node: '>=14.17'}
@@ -3029,12 +3229,18 @@ packages:
     resolution: {integrity: sha512-c1Q0mCiPlgdTVVVIJIrBuxNicYE+t/7oKeI9MWLj3fh/uq2Pxh/3eeWbVZ4OcGW1TUf53At0njHw5SMdA3tmMg==}
     engines: {node: '>= 0.10'}
 
+  vscode-languageserver-textdocument@1.0.11:
+    resolution: {integrity: sha512-X+8T3GoiwTVlJbicx/sIAF+yuJAqz8VvwJyoMVhwEMoEKE/fkDmrqUgDMyBECcM2A2frVZIUj5HI/ErRXCfOeA==}
+
   vscode-oniguruma@1.7.0:
     resolution: {integrity: sha512-L9WMGRfrjOhgHSdOYgCt/yRMsXzLDJSL7BPrOZt73gU0iWO4mpqzqQzOz5srxqTvMBaR0XZTSrVWo4j55Rc6cA==}
 
   vscode-textmate@8.0.0:
     resolution: {integrity: sha512-AFbieoL7a5LMqcnOF04ji+rpXadgOXnZsxQr//r83kLPr7biP7am3g9zbaZIaBGwBRWeSvoMD4mgPdX3e4NWBg==}
 
+  vscode-uri@3.0.8:
+    resolution: {integrity: sha512-AyFQ0EVmsOZOlAnxoFOGOq1SQDWAB7C6aqMGS23svWAllfOaxbuFvcT8D1i8z3Gyn8fraVeZNNmN6e9bxxXkKw==}
+
   wcwidth@1.0.1:
     resolution: {integrity: sha512-XHPEwS0q6TaxcvG85+8EYkbiCux2XtWG2mkc47Ng2A77BQu9+DqIOJldST4HgPkuea7dvKSj5VgX3P1d4rW8Tg==}
 
@@ -3299,28 +3505,215 @@ snapshots:
       '@types/conventional-commits-parser': 5.0.0
       chalk: 5.3.0
 
-  '@es-joy/jsdoccomment@0.43.1':
+  '@cspell/cspell-bundled-dicts@8.8.3':
+    dependencies:
+      '@cspell/dict-ada': 4.0.2
+      '@cspell/dict-aws': 4.0.2
+      '@cspell/dict-bash': 4.1.3
+      '@cspell/dict-companies': 3.1.2
+      '@cspell/dict-cpp': 5.1.8
+      '@cspell/dict-cryptocurrencies': 5.0.0
+      '@cspell/dict-csharp': 4.0.2
+      '@cspell/dict-css': 4.0.12
+      '@cspell/dict-dart': 2.0.3
+      '@cspell/dict-django': 4.1.0
+      '@cspell/dict-docker': 1.1.7
+      '@cspell/dict-dotnet': 5.0.2
+      '@cspell/dict-elixir': 4.0.3
+      '@cspell/dict-en-common-misspellings': 2.0.1
+      '@cspell/dict-en-gb': 1.1.33
+      '@cspell/dict-en_us': 4.3.21
+      '@cspell/dict-filetypes': 3.0.4
+      '@cspell/dict-fonts': 4.0.0
+      '@cspell/dict-fsharp': 1.0.1
+      '@cspell/dict-fullstack': 3.1.8
+      '@cspell/dict-gaming-terms': 1.0.5
+      '@cspell/dict-git': 3.0.0
+      '@cspell/dict-golang': 6.0.9
+      '@cspell/dict-google': 1.0.1
+      '@cspell/dict-haskell': 4.0.1
+      '@cspell/dict-html': 4.0.5
+      '@cspell/dict-html-symbol-entities': 4.0.0
+      '@cspell/dict-java': 5.0.6
+      '@cspell/dict-julia': 1.0.1
+      '@cspell/dict-k8s': 1.0.5
+      '@cspell/dict-latex': 4.0.0
+      '@cspell/dict-lorem-ipsum': 4.0.0
+      '@cspell/dict-lua': 4.0.3
+      '@cspell/dict-makefile': 1.0.0
+      '@cspell/dict-monkeyc': 1.0.6
+      '@cspell/dict-node': 5.0.1
+      '@cspell/dict-npm': 5.0.16
+      '@cspell/dict-php': 4.0.7
+      '@cspell/dict-powershell': 5.0.4
+      '@cspell/dict-public-licenses': 2.0.7
+      '@cspell/dict-python': 4.1.11
+      '@cspell/dict-r': 2.0.1
+      '@cspell/dict-ruby': 5.0.2
+      '@cspell/dict-rust': 4.0.3
+      '@cspell/dict-scala': 5.0.2
+      '@cspell/dict-software-terms': 3.4.0
+      '@cspell/dict-sql': 2.1.3
+      '@cspell/dict-svelte': 1.0.2
+      '@cspell/dict-swift': 2.0.1
+      '@cspell/dict-terraform': 1.0.0
+      '@cspell/dict-typescript': 3.1.5
+      '@cspell/dict-vue': 3.0.0
+
+  '@cspell/cspell-pipe@8.8.3': {}
+
+  '@cspell/cspell-resolver@8.8.3':
     dependencies:
-      '@types/eslint': 8.56.10
-      '@types/estree': 1.0.5
-      '@typescript-eslint/types': 7.11.0
-      comment-parser: 1.4.1
-      esquery: 1.5.0
-      jsdoc-type-pratt-parser: 4.0.0
+      global-directory: 4.0.1
+
+  '@cspell/cspell-service-bus@8.8.3': {}
+
+  '@cspell/cspell-types@8.8.3': {}
+
+  '@cspell/dict-ada@4.0.2': {}
+
+  '@cspell/dict-aws@4.0.2': {}
+
+  '@cspell/dict-bash@4.1.3': {}
+
+  '@cspell/dict-companies@3.1.2': {}
+
+  '@cspell/dict-cpp@5.1.8': {}
+
+  '@cspell/dict-cryptocurrencies@5.0.0': {}
+
+  '@cspell/dict-csharp@4.0.2': {}
+
+  '@cspell/dict-css@4.0.12': {}
+
+  '@cspell/dict-dart@2.0.3': {}
+
+  '@cspell/dict-data-science@1.0.11': {}
+
+  '@cspell/dict-django@4.1.0': {}
+
+  '@cspell/dict-docker@1.1.7': {}
+
+  '@cspell/dict-dotnet@5.0.2': {}
+
+  '@cspell/dict-elixir@4.0.3': {}
+
+  '@cspell/dict-en-common-misspellings@2.0.1': {}
+
+  '@cspell/dict-en-gb@1.1.33': {}
+
+  '@cspell/dict-en_us@4.3.21': {}
+
+  '@cspell/dict-filetypes@3.0.4': {}
+
+  '@cspell/dict-fonts@4.0.0': {}
+
+  '@cspell/dict-fsharp@1.0.1': {}
+
+  '@cspell/dict-fullstack@3.1.8': {}
+
+  '@cspell/dict-gaming-terms@1.0.5': {}
+
+  '@cspell/dict-git@3.0.0': {}
+
+  '@cspell/dict-golang@6.0.9': {}
+
+  '@cspell/dict-google@1.0.1': {}
+
+  '@cspell/dict-haskell@4.0.1': {}
+
+  '@cspell/dict-html-symbol-entities@4.0.0': {}
+
+  '@cspell/dict-html@4.0.5': {}
+
+  '@cspell/dict-java@5.0.6': {}
+
+  '@cspell/dict-julia@1.0.1': {}
+
+  '@cspell/dict-k8s@1.0.5': {}
+
+  '@cspell/dict-latex@4.0.0': {}
+
+  '@cspell/dict-lorem-ipsum@4.0.0': {}
+
+  '@cspell/dict-lua@4.0.3': {}
+
+  '@cspell/dict-makefile@1.0.0': {}
+
+  '@cspell/dict-monkeyc@1.0.6': {}
+
+  '@cspell/dict-node@5.0.1': {}
 
-  '@eslint-community/eslint-utils@4.4.0(eslint@8.57.0)':
+  '@cspell/dict-npm@5.0.16': {}
+
+  '@cspell/dict-php@4.0.7': {}
+
+  '@cspell/dict-powershell@5.0.4': {}
+
+  '@cspell/dict-public-licenses@2.0.7': {}
+
+  '@cspell/dict-python@4.1.11':
+    dependencies:
+      '@cspell/dict-data-science': 1.0.11
+
+  '@cspell/dict-r@2.0.1': {}
+
+  '@cspell/dict-ruby@5.0.2': {}
+
+  '@cspell/dict-rust@4.0.3': {}
+
+  '@cspell/dict-scala@5.0.2': {}
+
+  '@cspell/dict-software-terms@3.4.0': {}
+
+  '@cspell/dict-sql@2.1.3': {}
+
+  '@cspell/dict-svelte@1.0.2': {}
+
+  '@cspell/dict-swift@2.0.1': {}
+
+  '@cspell/dict-terraform@1.0.0': {}
+
+  '@cspell/dict-typescript@3.1.5': {}
+
+  '@cspell/dict-vue@3.0.0': {}
+
+  '@cspell/dynamic-import@8.8.3':
+    dependencies:
+      import-meta-resolve: 4.1.0
+
+  '@cspell/eslint-plugin@8.8.3(eslint@9.3.0)':
     dependencies:
-      eslint: 8.57.0
+      '@cspell/cspell-types': 8.8.3
+      cspell-lib: 8.8.3
+      eslint: 9.3.0
+      estree-walker: 3.0.3
+      synckit: 0.9.0
+
+  '@cspell/strong-weak-map@8.8.3': {}
+
+  '@es-joy/jsdoccomment@0.43.1':
+    dependencies:
+      '@types/eslint': 8.56.10
+      '@types/estree': 1.0.5
+      '@typescript-eslint/types': 7.11.0
+      comment-parser: 1.4.1
+      esquery: 1.5.0
+      jsdoc-type-pratt-parser: 4.0.0
+
+  '@eslint-community/eslint-utils@4.4.0(eslint@9.3.0)':
+    dependencies:
+      eslint: 9.3.0
       eslint-visitor-keys: 3.4.3
 
   '@eslint-community/regexpp@4.10.0': {}
 
-  '@eslint/eslintrc@2.1.4':
+  '@eslint/eslintrc@3.1.0':
     dependencies:
       ajv: 6.12.6
       debug: 4.3.4(supports-color@8.1.1)
-      espree: 9.6.1
-      globals: 13.24.0
+      espree: 10.0.1
+      globals: 14.0.0
       ignore: 5.3.1
       import-fresh: 3.3.0
       js-yaml: 4.1.0
@@ -3329,9 +3722,9 @@ snapshots:
     transitivePeerDependencies:
       - supports-color
 
-  '@eslint/js@8.57.0': {}
+  '@eslint/js@9.3.0': {}
 
-  '@humanwhocodes/config-array@0.11.14':
+  '@humanwhocodes/config-array@0.13.0':
     dependencies:
       '@humanwhocodes/object-schema': 2.0.3
       debug: 4.3.4(supports-color@8.1.1)
@@ -3343,6 +3736,8 @@ snapshots:
 
   '@humanwhocodes/object-schema@2.0.3': {}
 
+  '@humanwhocodes/retry@0.3.0': {}
+
   '@iarna/toml@2.2.5': {}
 
   '@inquirer/figures@1.0.2': {}
@@ -3392,15 +3787,6 @@ snapshots:
     dependencies:
       call-bind: 1.0.7
 
-  '@microsoft/tsdoc-config@0.17.0':
-    dependencies:
-      '@microsoft/tsdoc': 0.15.0
-      ajv: 8.12.0
-      jju: 1.4.0
-      resolve: 1.22.8
-
-  '@microsoft/tsdoc@0.15.0': {}
-
   '@nodelib/fs.scandir@2.1.5':
     dependencies:
       '@nodelib/fs.stat': 2.0.5
@@ -3476,6 +3862,8 @@ snapshots:
     dependencies:
       '@octokit/openapi-types': 22.2.0
 
+  '@pkgr/core@0.1.1': {}
+
   '@pnpm/config.env-replace@1.1.0': {}
 
   '@pnpm/network.ca-file@1.0.2':
@@ -3604,6 +3992,54 @@ snapshots:
 
   '@sinonjs/text-encoding@0.7.2': {}
 
+  '@stylistic/eslint-plugin-js@1.8.1(eslint@9.3.0)':
+    dependencies:
+      '@types/eslint': 8.56.10
+      acorn: 8.11.3
+      escape-string-regexp: 4.0.0
+      eslint: 9.3.0
+      eslint-visitor-keys: 3.4.3
+      espree: 9.6.1
+
+  '@stylistic/eslint-plugin-jsx@1.8.1(eslint@9.3.0)':
+    dependencies:
+      '@stylistic/eslint-plugin-js': 1.8.1(eslint@9.3.0)
+      '@types/eslint': 8.56.10
+      eslint: 9.3.0
+      estraverse: 5.3.0
+      picomatch: 4.0.2
+
+  '@stylistic/eslint-plugin-plus@1.8.1(eslint@9.3.0)(typescript@5.4.5)':
+    dependencies:
+      '@types/eslint': 8.56.10
+      '@typescript-eslint/utils': 6.21.0(eslint@9.3.0)(typescript@5.4.5)
+      eslint: 9.3.0
+    transitivePeerDependencies:
+      - supports-color
+      - typescript
+
+  '@stylistic/eslint-plugin-ts@1.8.1(eslint@9.3.0)(typescript@5.4.5)':
+    dependencies:
+      '@stylistic/eslint-plugin-js': 1.8.1(eslint@9.3.0)
+      '@types/eslint': 8.56.10
+      '@typescript-eslint/utils': 6.21.0(eslint@9.3.0)(typescript@5.4.5)
+      eslint: 9.3.0
+    transitivePeerDependencies:
+      - supports-color
+      - typescript
+
+  '@stylistic/eslint-plugin@1.8.1(eslint@9.3.0)(typescript@5.4.5)':
+    dependencies:
+      '@stylistic/eslint-plugin-js': 1.8.1(eslint@9.3.0)
+      '@stylistic/eslint-plugin-jsx': 1.8.1(eslint@9.3.0)
+      '@stylistic/eslint-plugin-plus': 1.8.1(eslint@9.3.0)(typescript@5.4.5)
+      '@stylistic/eslint-plugin-ts': 1.8.1(eslint@9.3.0)(typescript@5.4.5)
+      '@types/eslint': 8.56.10
+      eslint: 9.3.0
+    transitivePeerDependencies:
+      - supports-color
+      - typescript
+
   '@szmarczak/http-timer@5.0.1':
     dependencies:
       defer-to-connect: 2.0.1
@@ -3640,14 +4076,14 @@ snapshots:
 
   '@types/json-schema@7.0.15': {}
 
-  '@types/json5@0.0.29': {}
-
   '@types/minimatch@5.1.2': {}
 
   '@types/node@20.12.13':
     dependencies:
       undici-types: 5.26.5
 
+  '@types/semver@7.5.8': {}
+
   '@types/stack-utils@2.0.3': {}
 
   '@types/yargs-parser@21.0.3': {}
@@ -3656,15 +4092,15 @@ snapshots:
     dependencies:
       '@types/yargs-parser': 21.0.3
 
-  '@typescript-eslint/eslint-plugin@7.11.0(@typescript-eslint/parser@7.11.0(eslint@8.57.0)(typescript@5.4.5))(eslint@8.57.0)(typescript@5.4.5)':
+  '@typescript-eslint/eslint-plugin@8.0.0-alpha.23(@typescript-eslint/parser@8.0.0-alpha.23(eslint@9.3.0)(typescript@5.4.5))(eslint@9.3.0)(typescript@5.4.5)':
     dependencies:
       '@eslint-community/regexpp': 4.10.0
-      '@typescript-eslint/parser': 7.11.0(eslint@8.57.0)(typescript@5.4.5)
-      '@typescript-eslint/scope-manager': 7.11.0
-      '@typescript-eslint/type-utils': 7.11.0(eslint@8.57.0)(typescript@5.4.5)
-      '@typescript-eslint/utils': 7.11.0(eslint@8.57.0)(typescript@5.4.5)
-      '@typescript-eslint/visitor-keys': 7.11.0
-      eslint: 8.57.0
+      '@typescript-eslint/parser': 8.0.0-alpha.23(eslint@9.3.0)(typescript@5.4.5)
+      '@typescript-eslint/scope-manager': 8.0.0-alpha.23
+      '@typescript-eslint/type-utils': 8.0.0-alpha.23(eslint@9.3.0)(typescript@5.4.5)
+      '@typescript-eslint/utils': 8.0.0-alpha.23(eslint@9.3.0)(typescript@5.4.5)
+      '@typescript-eslint/visitor-keys': 8.0.0-alpha.23
+      eslint: 9.3.0
       graphemer: 1.4.0
       ignore: 5.3.1
       natural-compare: 1.4.0
@@ -3674,42 +4110,66 @@ snapshots:
     transitivePeerDependencies:
       - supports-color
 
-  '@typescript-eslint/parser@7.11.0(eslint@8.57.0)(typescript@5.4.5)':
+  '@typescript-eslint/parser@8.0.0-alpha.23(eslint@9.3.0)(typescript@5.4.5)':
     dependencies:
-      '@typescript-eslint/scope-manager': 7.11.0
-      '@typescript-eslint/types': 7.11.0
-      '@typescript-eslint/typescript-estree': 7.11.0(typescript@5.4.5)
-      '@typescript-eslint/visitor-keys': 7.11.0
+      '@typescript-eslint/scope-manager': 8.0.0-alpha.23
+      '@typescript-eslint/types': 8.0.0-alpha.23
+      '@typescript-eslint/typescript-estree': 8.0.0-alpha.23(typescript@5.4.5)
+      '@typescript-eslint/visitor-keys': 8.0.0-alpha.23
       debug: 4.3.4(supports-color@8.1.1)
-      eslint: 8.57.0
+      eslint: 9.3.0
     optionalDependencies:
       typescript: 5.4.5
     transitivePeerDependencies:
       - supports-color
 
-  '@typescript-eslint/scope-manager@7.11.0':
+  '@typescript-eslint/scope-manager@6.21.0':
     dependencies:
-      '@typescript-eslint/types': 7.11.0
-      '@typescript-eslint/visitor-keys': 7.11.0
+      '@typescript-eslint/types': 6.21.0
+      '@typescript-eslint/visitor-keys': 6.21.0
 
-  '@typescript-eslint/type-utils@7.11.0(eslint@8.57.0)(typescript@5.4.5)':
+  '@typescript-eslint/scope-manager@8.0.0-alpha.23':
     dependencies:
-      '@typescript-eslint/typescript-estree': 7.11.0(typescript@5.4.5)
-      '@typescript-eslint/utils': 7.11.0(eslint@8.57.0)(typescript@5.4.5)
+      '@typescript-eslint/types': 8.0.0-alpha.23
+      '@typescript-eslint/visitor-keys': 8.0.0-alpha.23
+
+  '@typescript-eslint/type-utils@8.0.0-alpha.23(eslint@9.3.0)(typescript@5.4.5)':
+    dependencies:
+      '@typescript-eslint/typescript-estree': 8.0.0-alpha.23(typescript@5.4.5)
+      '@typescript-eslint/utils': 8.0.0-alpha.23(eslint@9.3.0)(typescript@5.4.5)
       debug: 4.3.4(supports-color@8.1.1)
-      eslint: 8.57.0
       ts-api-utils: 1.3.0(typescript@5.4.5)
     optionalDependencies:
       typescript: 5.4.5
     transitivePeerDependencies:
+      - eslint
       - supports-color
 
+  '@typescript-eslint/types@6.21.0': {}
+
   '@typescript-eslint/types@7.11.0': {}
 
-  '@typescript-eslint/typescript-estree@7.11.0(typescript@5.4.5)':
+  '@typescript-eslint/types@8.0.0-alpha.23': {}
+
+  '@typescript-eslint/typescript-estree@6.21.0(typescript@5.4.5)':
     dependencies:
-      '@typescript-eslint/types': 7.11.0
-      '@typescript-eslint/visitor-keys': 7.11.0
+      '@typescript-eslint/types': 6.21.0
+      '@typescript-eslint/visitor-keys': 6.21.0
+      debug: 4.3.4(supports-color@8.1.1)
+      globby: 11.1.0
+      is-glob: 4.0.3
+      minimatch: 9.0.3
+      semver: 7.6.2
+      ts-api-utils: 1.3.0(typescript@5.4.5)
+    optionalDependencies:
+      typescript: 5.4.5
+    transitivePeerDependencies:
+      - supports-color
+
+  '@typescript-eslint/typescript-estree@8.0.0-alpha.23(typescript@5.4.5)':
+    dependencies:
+      '@typescript-eslint/types': 8.0.0-alpha.23
+      '@typescript-eslint/visitor-keys': 8.0.0-alpha.23
       debug: 4.3.4(supports-color@8.1.1)
       globby: 11.1.0
       is-glob: 4.0.3
@@ -3721,23 +4181,40 @@ snapshots:
     transitivePeerDependencies:
       - supports-color
 
-  '@typescript-eslint/utils@7.11.0(eslint@8.57.0)(typescript@5.4.5)':
+  '@typescript-eslint/utils@6.21.0(eslint@9.3.0)(typescript@5.4.5)':
     dependencies:
-      '@eslint-community/eslint-utils': 4.4.0(eslint@8.57.0)
-      '@typescript-eslint/scope-manager': 7.11.0
-      '@typescript-eslint/types': 7.11.0
-      '@typescript-eslint/typescript-estree': 7.11.0(typescript@5.4.5)
-      eslint: 8.57.0
+      '@eslint-community/eslint-utils': 4.4.0(eslint@9.3.0)
+      '@types/json-schema': 7.0.15
+      '@types/semver': 7.5.8
+      '@typescript-eslint/scope-manager': 6.21.0
+      '@typescript-eslint/types': 6.21.0
+      '@typescript-eslint/typescript-estree': 6.21.0(typescript@5.4.5)
+      eslint: 9.3.0
+      semver: 7.6.2
     transitivePeerDependencies:
       - supports-color
       - typescript
 
-  '@typescript-eslint/visitor-keys@7.11.0':
+  '@typescript-eslint/utils@8.0.0-alpha.23(eslint@9.3.0)(typescript@5.4.5)':
     dependencies:
-      '@typescript-eslint/types': 7.11.0
+      '@eslint-community/eslint-utils': 4.4.0(eslint@9.3.0)
+      '@typescript-eslint/scope-manager': 8.0.0-alpha.23
+      '@typescript-eslint/types': 8.0.0-alpha.23
+      '@typescript-eslint/typescript-estree': 8.0.0-alpha.23(typescript@5.4.5)
+      eslint: 9.3.0
+    transitivePeerDependencies:
+      - supports-color
+      - typescript
+
+  '@typescript-eslint/visitor-keys@6.21.0':
+    dependencies:
+      '@typescript-eslint/types': 6.21.0
       eslint-visitor-keys: 3.4.3
 
-  '@ungap/structured-clone@1.2.0': {}
+  '@typescript-eslint/visitor-keys@8.0.0-alpha.23':
+    dependencies:
+      '@typescript-eslint/types': 8.0.0-alpha.23
+      eslint-visitor-keys: 3.4.3
 
   JSONStream@1.3.5:
     dependencies:
@@ -3768,13 +4245,6 @@ snapshots:
       json-schema-traverse: 0.4.1
       uri-js: 4.4.1
 
-  ajv@8.12.0:
-    dependencies:
-      fast-deep-equal: 3.1.3
-      json-schema-traverse: 1.0.0
-      require-from-string: 2.0.2
-      uri-js: 4.4.1
-
   ajv@8.14.0:
     dependencies:
       fast-deep-equal: 3.1.3
@@ -3828,40 +4298,10 @@ snapshots:
 
   array-ify@1.0.0: {}
 
-  array-includes@3.1.8:
-    dependencies:
-      call-bind: 1.0.7
-      define-properties: 1.2.1
-      es-abstract: 1.23.3
-      es-object-atoms: 1.0.0
-      get-intrinsic: 1.2.4
-      is-string: 1.0.7
+  array-timsort@1.0.3: {}
 
   array-union@2.1.0: {}
 
-  array.prototype.findlastindex@1.2.5:
-    dependencies:
-      call-bind: 1.0.7
-      define-properties: 1.2.1
-      es-abstract: 1.23.3
-      es-errors: 1.3.0
-      es-object-atoms: 1.0.0
-      es-shim-unscopables: 1.0.2
-
-  array.prototype.flat@1.3.2:
-    dependencies:
-      call-bind: 1.0.7
-      define-properties: 1.2.1
-      es-abstract: 1.23.3
-      es-shim-unscopables: 1.0.2
-
-  array.prototype.flatmap@1.3.2:
-    dependencies:
-      call-bind: 1.0.7
-      define-properties: 1.2.1
-      es-abstract: 1.23.3
-      es-shim-unscopables: 1.0.2
-
   array.prototype.map@1.0.7:
     dependencies:
       call-bind: 1.0.7
@@ -4018,6 +4458,11 @@ snapshots:
 
   clean-stack@2.2.0: {}
 
+  clear-module@4.1.2:
+    dependencies:
+      parent-module: 2.0.0
+      resolve-from: 5.0.0
+
   cli-boxes@3.0.0: {}
 
   cli-cursor@3.1.0:
@@ -4069,6 +4514,14 @@ snapshots:
 
   commander@2.20.3: {}
 
+  comment-json@4.2.3:
+    dependencies:
+      array-timsort: 1.0.3
+      core-util-is: 1.0.3
+      esprima: 4.0.1
+      has-own-prop: 2.0.0
+      repeat-string: 1.6.1
+
   comment-parser@1.4.1: {}
 
   compare-func@2.0.0:
@@ -4108,6 +4561,8 @@ snapshots:
 
   convert-source-map@2.0.0: {}
 
+  core-util-is@1.0.3: {}
+
   cosmiconfig-typescript-loader@5.0.0(@types/node@20.12.13)(cosmiconfig@9.0.0(typescript@5.4.5))(typescript@5.4.5):
     dependencies:
       '@types/node': 20.12.13
@@ -4138,6 +4593,64 @@ snapshots:
     dependencies:
       type-fest: 1.4.0
 
+  cspell-config-lib@8.8.3:
+    dependencies:
+      '@cspell/cspell-types': 8.8.3
+      comment-json: 4.2.3
+      yaml: 2.4.2
+
+  cspell-dictionary@8.8.3:
+    dependencies:
+      '@cspell/cspell-pipe': 8.8.3
+      '@cspell/cspell-types': 8.8.3
+      cspell-trie-lib: 8.8.3
+      fast-equals: 5.0.1
+      gensequence: 7.0.0
+
+  cspell-glob@8.8.3:
+    dependencies:
+      micromatch: 4.0.7
+
+  cspell-grammar@8.8.3:
+    dependencies:
+      '@cspell/cspell-pipe': 8.8.3
+      '@cspell/cspell-types': 8.8.3
+
+  cspell-io@8.8.3:
+    dependencies:
+      '@cspell/cspell-service-bus': 8.8.3
+
+  cspell-lib@8.8.3:
+    dependencies:
+      '@cspell/cspell-bundled-dicts': 8.8.3
+      '@cspell/cspell-pipe': 8.8.3
+      '@cspell/cspell-resolver': 8.8.3
+      '@cspell/cspell-types': 8.8.3
+      '@cspell/dynamic-import': 8.8.3
+      '@cspell/strong-weak-map': 8.8.3
+      clear-module: 4.1.2
+      comment-json: 4.2.3
+      cspell-config-lib: 8.8.3
+      cspell-dictionary: 8.8.3
+      cspell-glob: 8.8.3
+      cspell-grammar: 8.8.3
+      cspell-io: 8.8.3
+      cspell-trie-lib: 8.8.3
+      env-paths: 3.0.0
+      fast-equals: 5.0.1
+      gensequence: 7.0.0
+      import-fresh: 3.3.0
+      resolve-from: 5.0.0
+      vscode-languageserver-textdocument: 1.0.11
+      vscode-uri: 3.0.8
+      xdg-basedir: 5.1.0
+
+  cspell-trie-lib@8.8.3:
+    dependencies:
+      '@cspell/cspell-pipe': 8.8.3
+      '@cspell/cspell-types': 8.8.3
+      gensequence: 7.0.0
+
   dargs@8.1.0: {}
 
   data-uri-to-buffer@4.0.1: {}
@@ -4164,10 +4677,6 @@ snapshots:
 
   dateformat@4.6.3: {}
 
-  debug@3.2.7:
-    dependencies:
-      ms: 2.1.3
-
   debug@4.3.4(supports-color@8.1.1):
     dependencies:
       ms: 2.1.2
@@ -4244,14 +4753,6 @@ snapshots:
     dependencies:
       path-type: 4.0.0
 
-  doctrine@2.1.0:
-    dependencies:
-      esutils: 2.0.3
-
-  doctrine@3.0.0:
-    dependencies:
-      esutils: 2.0.3
-
   dot-prop@5.3.0:
     dependencies:
       is-obj: 2.0.0
@@ -4275,6 +4776,8 @@ snapshots:
 
   env-paths@2.2.1: {}
 
+  env-paths@3.0.0: {}
+
   error-ex@1.3.2:
     dependencies:
       is-arrayish: 0.2.1
@@ -4358,10 +4861,6 @@ snapshots:
       has-tostringtag: 1.0.2
       hasown: 2.0.2
 
-  es-shim-unscopables@1.0.2:
-    dependencies:
-      hasown: 2.0.2
-
   es-to-primitive@1.2.1:
     dependencies:
       is-callable: 1.2.7
@@ -4388,187 +4887,87 @@ snapshots:
     optionalDependencies:
       source-map: 0.6.1
 
-  eslint-compat-utils@0.5.0(eslint@8.57.0):
+  eslint-compat-utils@0.5.0(eslint@9.3.0):
     dependencies:
-      eslint: 8.57.0
+      eslint: 9.3.0
       semver: 7.6.2
 
-  eslint-config-love@47.0.0(@typescript-eslint/eslint-plugin@7.11.0(@typescript-eslint/parser@7.11.0(eslint@8.57.0)(typescript@5.4.5))(eslint@8.57.0)(typescript@5.4.5))(eslint-plugin-import@2.29.1(@typescript-eslint/parser@7.11.0(eslint@8.57.0)(typescript@5.4.5))(eslint-import-resolver-typescript@3.6.1)(eslint@8.57.0))(eslint-plugin-n@17.7.0(eslint@8.57.0))(eslint-plugin-promise@6.2.0(eslint@8.57.0))(eslint@8.57.0)(typescript@5.4.5):
-    dependencies:
-      '@typescript-eslint/eslint-plugin': 7.11.0(@typescript-eslint/parser@7.11.0(eslint@8.57.0)(typescript@5.4.5))(eslint@8.57.0)(typescript@5.4.5)
-      '@typescript-eslint/parser': 7.11.0(eslint@8.57.0)(typescript@5.4.5)
-      eslint: 8.57.0
-      eslint-plugin-import: 2.29.1(@typescript-eslint/parser@7.11.0(eslint@8.57.0)(typescript@5.4.5))(eslint-import-resolver-typescript@3.6.1)(eslint@8.57.0)
-      eslint-plugin-n: 17.7.0(eslint@8.57.0)
-      eslint-plugin-promise: 6.2.0(eslint@8.57.0)
-      typescript: 5.4.5
-    transitivePeerDependencies:
-      - supports-color
-
-  eslint-config-standard@17.1.0(eslint-plugin-import@2.29.1(@typescript-eslint/parser@7.11.0(eslint@8.57.0)(typescript@5.4.5))(eslint-import-resolver-typescript@3.6.1)(eslint@8.57.0))(eslint-plugin-n@17.7.0(eslint@8.57.0))(eslint-plugin-promise@6.2.0(eslint@8.57.0))(eslint@8.57.0):
-    dependencies:
-      eslint: 8.57.0
-      eslint-plugin-import: 2.29.1(@typescript-eslint/parser@7.11.0(eslint@8.57.0)(typescript@5.4.5))(eslint-import-resolver-typescript@3.6.1)(eslint@8.57.0)
-      eslint-plugin-n: 17.7.0(eslint@8.57.0)
-      eslint-plugin-promise: 6.2.0(eslint@8.57.0)
-
   eslint-define-config@2.1.0: {}
 
-  eslint-import-resolver-node@0.3.9:
-    dependencies:
-      debug: 3.2.7
-      is-core-module: 2.13.1
-      resolve: 1.22.8
-    transitivePeerDependencies:
-      - supports-color
-
-  eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@7.11.0(eslint@8.57.0)(typescript@5.4.5))(eslint-plugin-import@2.29.1)(eslint@8.57.0):
+  eslint-plugin-es-x@7.6.0(eslint@9.3.0):
     dependencies:
-      debug: 4.3.4(supports-color@8.1.1)
-      enhanced-resolve: 5.16.1
-      eslint: 8.57.0
-      eslint-module-utils: 2.8.1(@typescript-eslint/parser@7.11.0(eslint@8.57.0)(typescript@5.4.5))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@7.11.0(eslint@8.57.0)(typescript@5.4.5))(eslint-plugin-import@2.29.1)(eslint@8.57.0))(eslint@8.57.0)
-      eslint-plugin-import: 2.29.1(@typescript-eslint/parser@7.11.0(eslint@8.57.0)(typescript@5.4.5))(eslint-import-resolver-typescript@3.6.1)(eslint@8.57.0)
-      fast-glob: 3.3.2
-      get-tsconfig: 4.7.5
-      is-core-module: 2.13.1
-      is-glob: 4.0.3
-    transitivePeerDependencies:
-      - '@typescript-eslint/parser'
-      - eslint-import-resolver-node
-      - eslint-import-resolver-webpack
-      - supports-color
-
-  eslint-module-utils@2.8.1(@typescript-eslint/parser@7.11.0(eslint@8.57.0)(typescript@5.4.5))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@7.11.0(eslint@8.57.0)(typescript@5.4.5))(eslint-plugin-import@2.29.1)(eslint@8.57.0))(eslint@8.57.0):
-    dependencies:
-      debug: 3.2.7
-    optionalDependencies:
-      '@typescript-eslint/parser': 7.11.0(eslint@8.57.0)(typescript@5.4.5)
-      eslint: 8.57.0
-      eslint-import-resolver-node: 0.3.9
-      eslint-import-resolver-typescript: 3.6.1(@typescript-eslint/parser@7.11.0(eslint@8.57.0)(typescript@5.4.5))(eslint-plugin-import@2.29.1)(eslint@8.57.0)
-    transitivePeerDependencies:
-      - supports-color
-
-  eslint-plugin-es-x@7.6.0(eslint@8.57.0):
-    dependencies:
-      '@eslint-community/eslint-utils': 4.4.0(eslint@8.57.0)
+      '@eslint-community/eslint-utils': 4.4.0(eslint@9.3.0)
       '@eslint-community/regexpp': 4.10.0
-      eslint: 8.57.0
-      eslint-compat-utils: 0.5.0(eslint@8.57.0)
-
-  eslint-plugin-import@2.29.1(@typescript-eslint/parser@7.11.0(eslint@8.57.0)(typescript@5.4.5))(eslint-import-resolver-typescript@3.6.1)(eslint@8.57.0):
-    dependencies:
-      array-includes: 3.1.8
-      array.prototype.findlastindex: 1.2.5
-      array.prototype.flat: 1.3.2
-      array.prototype.flatmap: 1.3.2
-      debug: 3.2.7
-      doctrine: 2.1.0
-      eslint: 8.57.0
-      eslint-import-resolver-node: 0.3.9
-      eslint-module-utils: 2.8.1(@typescript-eslint/parser@7.11.0(eslint@8.57.0)(typescript@5.4.5))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@7.11.0(eslint@8.57.0)(typescript@5.4.5))(eslint-plugin-import@2.29.1)(eslint@8.57.0))(eslint@8.57.0)
-      hasown: 2.0.2
-      is-core-module: 2.13.1
-      is-glob: 4.0.3
-      minimatch: 3.1.2
-      object.fromentries: 2.0.8
-      object.groupby: 1.0.3
-      object.values: 1.2.0
-      semver: 7.6.2
-      tsconfig-paths: 3.15.0
-    optionalDependencies:
-      '@typescript-eslint/parser': 7.11.0(eslint@8.57.0)(typescript@5.4.5)
-    transitivePeerDependencies:
-      - eslint-import-resolver-typescript
-      - eslint-import-resolver-webpack
-      - supports-color
+      eslint: 9.3.0
+      eslint-compat-utils: 0.5.0(eslint@9.3.0)
 
-  eslint-plugin-jsdoc@48.2.7(eslint@8.57.0):
+  eslint-plugin-jsdoc@48.2.7(eslint@9.3.0):
     dependencies:
       '@es-joy/jsdoccomment': 0.43.1
       are-docs-informative: 0.0.2
       comment-parser: 1.4.1
       debug: 4.3.4(supports-color@8.1.1)
       escape-string-regexp: 4.0.0
-      eslint: 8.57.0
+      eslint: 9.3.0
       esquery: 1.5.0
       semver: 7.6.2
       spdx-expression-parse: 4.0.0
     transitivePeerDependencies:
       - supports-color
 
-  eslint-plugin-n@17.7.0(eslint@8.57.0):
+  eslint-plugin-n@17.7.0(eslint@9.3.0):
     dependencies:
-      '@eslint-community/eslint-utils': 4.4.0(eslint@8.57.0)
+      '@eslint-community/eslint-utils': 4.4.0(eslint@9.3.0)
       enhanced-resolve: 5.16.1
-      eslint: 8.57.0
-      eslint-plugin-es-x: 7.6.0(eslint@8.57.0)
+      eslint: 9.3.0
+      eslint-plugin-es-x: 7.6.0(eslint@9.3.0)
       get-tsconfig: 4.7.5
       globals: 15.3.0
       ignore: 5.3.1
       minimatch: 9.0.4
       semver: 7.6.2
 
-  eslint-plugin-promise@6.2.0(eslint@8.57.0):
-    dependencies:
-      eslint: 8.57.0
-
-  eslint-plugin-simple-import-sort@12.1.0(eslint@8.57.0):
-    dependencies:
-      eslint: 8.57.0
-
-  eslint-plugin-spellcheck@0.0.20(eslint@8.57.0):
+  eslint-plugin-simple-import-sort@12.1.0(eslint@9.3.0):
     dependencies:
-      eslint: 8.57.0
-      globals: 13.24.0
-      hunspell-spellchecker: 1.0.2
-      lodash: 4.17.21
+      eslint: 9.3.0
 
-  eslint-plugin-tsdoc@0.3.0:
-    dependencies:
-      '@microsoft/tsdoc': 0.15.0
-      '@microsoft/tsdoc-config': 0.17.0
-
-  eslint-scope@7.2.2:
+  eslint-scope@8.0.1:
     dependencies:
       esrecurse: 4.3.0
       estraverse: 5.3.0
 
   eslint-visitor-keys@3.4.3: {}
 
-  eslint@8.57.0:
+  eslint-visitor-keys@4.0.0: {}
+
+  eslint@9.3.0:
     dependencies:
-      '@eslint-community/eslint-utils': 4.4.0(eslint@8.57.0)
+      '@eslint-community/eslint-utils': 4.4.0(eslint@9.3.0)
       '@eslint-community/regexpp': 4.10.0
-      '@eslint/eslintrc': 2.1.4
-      '@eslint/js': 8.57.0
-      '@humanwhocodes/config-array': 0.11.14
+      '@eslint/eslintrc': 3.1.0
+      '@eslint/js': 9.3.0
+      '@humanwhocodes/config-array': 0.13.0
       '@humanwhocodes/module-importer': 1.0.1
+      '@humanwhocodes/retry': 0.3.0
       '@nodelib/fs.walk': 1.2.8
-      '@ungap/structured-clone': 1.2.0
       ajv: 6.12.6
       chalk: 4.1.2
       cross-spawn: 7.0.3
       debug: 4.3.4(supports-color@8.1.1)
-      doctrine: 3.0.0
       escape-string-regexp: 4.0.0
-      eslint-scope: 7.2.2
-      eslint-visitor-keys: 3.4.3
-      espree: 9.6.1
+      eslint-scope: 8.0.1
+      eslint-visitor-keys: 4.0.0
+      espree: 10.0.1
       esquery: 1.5.0
       esutils: 2.0.3
       fast-deep-equal: 3.1.3
-      file-entry-cache: 6.0.1
+      file-entry-cache: 8.0.0
       find-up: 5.0.0
       glob-parent: 6.0.2
-      globals: 13.24.0
-      graphemer: 1.4.0
       ignore: 5.3.1
       imurmurhash: 0.1.4
       is-glob: 4.0.3
       is-path-inside: 3.0.3
-      js-yaml: 4.1.0
       json-stable-stringify-without-jsonify: 1.0.1
       levn: 0.4.1
       lodash.merge: 4.6.2
@@ -4580,6 +4979,12 @@ snapshots:
     transitivePeerDependencies:
       - supports-color
 
+  espree@10.0.1:
+    dependencies:
+      acorn: 8.11.3
+      acorn-jsx: 5.3.2(acorn@8.11.3)
+      eslint-visitor-keys: 4.0.0
+
   espree@9.6.1:
     dependencies:
       acorn: 8.11.3
@@ -4600,6 +5005,10 @@ snapshots:
 
   estree-walker@2.0.2: {}
 
+  estree-walker@3.0.3:
+    dependencies:
+      '@types/estree': 1.0.5
+
   esutils@2.0.3: {}
 
   eventemitter3@5.0.1: {}
@@ -4644,6 +5053,8 @@ snapshots:
 
   fast-deep-equal@3.1.3: {}
 
+  fast-equals@5.0.1: {}
+
   fast-glob@3.3.2:
     dependencies:
       '@nodelib/fs.stat': 2.0.5
@@ -4665,9 +5076,9 @@ snapshots:
       node-domexception: 1.0.0
       web-streams-polyfill: 3.3.3
 
-  file-entry-cache@6.0.1:
+  file-entry-cache@8.0.0:
     dependencies:
-      flat-cache: 3.2.0
+      flat-cache: 4.0.1
 
   fill-range@7.1.1:
     dependencies:
@@ -4684,11 +5095,10 @@ snapshots:
       path-exists: 5.0.0
       unicorn-magic: 0.1.0
 
-  flat-cache@3.2.0:
+  flat-cache@4.0.1:
     dependencies:
       flatted: 3.3.1
       keyv: 4.5.4
-      rimraf: 3.0.2
 
   flat@5.0.2: {}
 
@@ -4739,6 +5149,8 @@ snapshots:
 
   functions-have-names@1.2.3: {}
 
+  gensequence@7.0.0: {}
+
   get-caller-file@2.0.5: {}
 
   get-east-asian-width@1.2.0: {}
@@ -4822,9 +5234,7 @@ snapshots:
     dependencies:
       ini: 2.0.0
 
-  globals@13.24.0:
-    dependencies:
-      type-fest: 0.20.2
+  globals@14.0.0: {}
 
   globals@15.3.0: {}
 
@@ -4906,6 +5316,8 @@ snapshots:
 
   has-flag@4.0.0: {}
 
+  has-own-prop@2.0.0: {}
+
   has-property-descriptors@1.0.2:
     dependencies:
       es-define-property: 1.0.0
@@ -4951,8 +5363,6 @@ snapshots:
 
   human-signals@5.0.0: {}
 
-  hunspell-spellchecker@1.0.2: {}
-
   husky@9.0.11: {}
 
   iconv-lite@0.4.24:
@@ -5238,8 +5648,6 @@ snapshots:
 
   jiti@1.21.0: {}
 
-  jju@1.4.0: {}
-
   js-tokens@4.0.0: {}
 
   js-yaml@4.1.0:
@@ -5262,10 +5670,6 @@ snapshots:
 
   json-stringify-safe@5.0.1: {}
 
-  json5@1.0.2:
-    dependencies:
-      minimist: 1.2.8
-
   jsonc-parser@3.2.1: {}
 
   jsonfile@6.1.0:
@@ -5438,6 +5842,10 @@ snapshots:
     dependencies:
       brace-expansion: 2.0.1
 
+  minimatch@9.0.3:
+    dependencies:
+      brace-expansion: 2.0.1
+
   minimatch@9.0.4:
     dependencies:
       brace-expansion: 2.0.1
@@ -5504,6 +5912,21 @@ snapshots:
 
   natural-compare@1.4.0: {}
 
+  neostandard@0.5.1(@typescript-eslint/parser@8.0.0-alpha.23(eslint@9.3.0)(typescript@5.4.5))(eslint@9.3.0)(typescript@5.4.5):
+    dependencies:
+      '@stylistic/eslint-plugin': 1.8.1(eslint@9.3.0)(typescript@5.4.5)
+      '@typescript-eslint/eslint-plugin': 8.0.0-alpha.23(@typescript-eslint/parser@8.0.0-alpha.23(eslint@9.3.0)(typescript@5.4.5))(eslint@9.3.0)(typescript@5.4.5)
+      '@typescript-eslint/utils': 8.0.0-alpha.23(eslint@9.3.0)(typescript@5.4.5)
+      eslint: 9.3.0
+      eslint-plugin-n: 17.7.0(eslint@9.3.0)
+      globals: 15.3.0
+      peowly: 1.3.0
+      typescript-eslint: 8.0.0-alpha.23(eslint@9.3.0)(typescript@5.4.5)
+    transitivePeerDependencies:
+      - '@typescript-eslint/parser'
+      - supports-color
+      - typescript
+
   netmask@2.0.2: {}
 
   new-github-release-url@2.0.0:
@@ -5551,25 +5974,6 @@ snapshots:
       has-symbols: 1.0.3
       object-keys: 1.1.1
 
-  object.fromentries@2.0.8:
-    dependencies:
-      call-bind: 1.0.7
-      define-properties: 1.2.1
-      es-abstract: 1.23.3
-      es-object-atoms: 1.0.0
-
-  object.groupby@1.0.3:
-    dependencies:
-      call-bind: 1.0.7
-      define-properties: 1.2.1
-      es-abstract: 1.23.3
-
-  object.values@1.2.0:
-    dependencies:
-      call-bind: 1.0.7
-      define-properties: 1.2.1
-      es-object-atoms: 1.0.0
-
   once@1.4.0:
     dependencies:
       wrappy: 1.0.2
@@ -5682,6 +6086,10 @@ snapshots:
     dependencies:
       callsites: 3.1.0
 
+  parent-module@2.0.0:
+    dependencies:
+      callsites: 3.1.0
+
   parse-json@5.2.0:
     dependencies:
       '@babel/code-frame': 7.24.6
@@ -5715,10 +6123,14 @@ snapshots:
 
   path-type@5.0.0: {}
 
+  peowly@1.3.0: {}
+
   picocolors@1.0.1: {}
 
   picomatch@2.3.1: {}
 
+  picomatch@4.0.2: {}
+
   pidtree@0.6.0: {}
 
   possible-typed-array-names@1.0.0: {}
@@ -5854,6 +6266,8 @@ snapshots:
       - supports-color
       - typescript
 
+  repeat-string@1.6.1: {}
+
   require-directory@2.1.1: {}
 
   require-from-string@2.0.2: {}
@@ -6146,8 +6560,6 @@ snapshots:
     dependencies:
       ansi-regex: 6.0.1
 
-  strip-bom@3.0.0: {}
-
   strip-final-newline@2.0.0: {}
 
   strip-final-newline@3.0.0: {}
@@ -6170,6 +6582,11 @@ snapshots:
 
   supports-preserve-symlinks-flag@1.0.0: {}
 
+  synckit@0.9.0:
+    dependencies:
+      '@pkgr/core': 0.1.1
+      tslib: 2.6.2
+
   tapable@2.2.1: {}
 
   tatami-ng@0.4.13(typescript@5.4.5):
@@ -6213,13 +6630,6 @@ snapshots:
     dependencies:
       typescript: 5.4.5
 
-  tsconfig-paths@3.15.0:
-    dependencies:
-      '@types/json5': 0.0.29
-      json5: 1.0.2
-      minimist: 1.2.8
-      strip-bom: 3.0.0
-
   tslib@2.6.2: {}
 
   type-check@0.4.0:
@@ -6228,8 +6638,6 @@ snapshots:
 
   type-detect@4.0.8: {}
 
-  type-fest@0.20.2: {}
-
   type-fest@0.21.3: {}
 
   type-fest@1.4.0: {}
@@ -6280,6 +6688,17 @@ snapshots:
       shiki: 0.14.7
       typescript: 5.4.5
 
+  typescript-eslint@8.0.0-alpha.23(eslint@9.3.0)(typescript@5.4.5):
+    dependencies:
+      '@typescript-eslint/eslint-plugin': 8.0.0-alpha.23(@typescript-eslint/parser@8.0.0-alpha.23(eslint@9.3.0)(typescript@5.4.5))(eslint@9.3.0)(typescript@5.4.5)
+      '@typescript-eslint/parser': 8.0.0-alpha.23(eslint@9.3.0)(typescript@5.4.5)
+      '@typescript-eslint/utils': 8.0.0-alpha.23(eslint@9.3.0)(typescript@5.4.5)
+    optionalDependencies:
+      typescript: 5.4.5
+    transitivePeerDependencies:
+      - eslint
+      - supports-color
+
   typescript@5.4.5: {}
 
   unbox-primitive@1.0.2:
@@ -6334,10 +6753,14 @@ snapshots:
 
   validator@13.12.0: {}
 
+  vscode-languageserver-textdocument@1.0.11: {}
+
   vscode-oniguruma@1.7.0: {}
 
   vscode-textmate@8.0.0: {}
 
+  vscode-uri@3.0.8: {}
+
   wcwidth@1.0.1:
     dependencies:
       defaults: 1.0.4
index 763a3e3c2a03dc87220846390705a64c0ab8308d..a6d7eae8e9b583565924217c1d953b2c861d27a7 100644 (file)
@@ -43,15 +43,15 @@ export default defineConfig([
               entryFileNames: '[name].cjs',
               chunkFileNames: '[name]-[hash].cjs',
               preserveModules: true,
-              preserveModulesRoot: './src'
+              preserveModulesRoot: './src',
             }
           : {
               file: './lib/index.cjs',
-              plugins: [terser({ maxWorkers })]
+              plugins: [terser({ maxWorkers })],
             }),
         ...(sourcemap && {
-          sourcemap
-        })
+          sourcemap,
+        }),
       },
       {
         format: 'esm',
@@ -61,31 +61,31 @@ export default defineConfig([
               entryFileNames: '[name].mjs',
               chunkFileNames: '[name]-[hash].mjs',
               preserveModules: true,
-              preserveModulesRoot: './src'
+              preserveModulesRoot: './src',
             }
           : {
               file: './lib/index.mjs',
-              plugins: [terser({ maxWorkers })]
+              plugins: [terser({ maxWorkers })],
             }),
         ...(sourcemap && {
-          sourcemap
-        })
-      }
+          sourcemap,
+        }),
+      },
     ],
     external: [/^node:*/],
     plugins: [
       typescript({
         tsconfig: './tsconfig.build.json',
         compilerOptions: {
-          sourceMap: sourcemap
-        }
+          sourceMap: sourcemap,
+        },
       }),
       del({
-        targets: ['./lib/*']
+        targets: ['./lib/*'],
       }),
       isAnalyzeBuild && analyze(),
-      isDocumentationBuild && command('pnpm typedoc')
-    ]
+      isDocumentationBuild && command('pnpm typedoc'),
+    ],
   },
   {
     input: './lib/dts/index.d.ts',
@@ -96,9 +96,9 @@ export default defineConfig([
       dts(),
       del({
         targets: ['./lib/dts'],
-        hook: 'buildEnd'
+        hook: 'buildEnd',
       }),
-      isAnalyzeBuild && analyze()
-    ]
-  }
+      isAnalyzeBuild && analyze(),
+    ],
+  },
 ])
index 7d12069fe369b48c72bf592d9b46a8eae0294031..b4a6003013e1aab89cb41a598c8e37e0470581ef 100644 (file)
@@ -5,7 +5,6 @@ export const defaultBufferSize = 2048
 
 /**
  * Circular buffer designed for positive numbers.
- *
  * @internal
  */
 export class CircularBuffer {
@@ -30,7 +29,6 @@ export class CircularBuffer {
 
   /**
    * Checks whether the buffer is empty.
-   *
    * @returns Whether the buffer is empty.
    */
   public empty (): boolean {
@@ -39,7 +37,6 @@ export class CircularBuffer {
 
   /**
    * Checks whether the buffer is full.
-   *
    * @returns Whether the buffer is full.
    */
   public full (): boolean {
@@ -48,7 +45,6 @@ export class CircularBuffer {
 
   /**
    * Puts number into buffer.
-   *
    * @param number - Number to put into buffer.
    */
   public put (number: number): void {
@@ -61,7 +57,6 @@ export class CircularBuffer {
 
   /**
    * Gets number from buffer.
-   *
    * @returns Number from buffer.
    */
   public get (): number | undefined {
@@ -77,7 +72,6 @@ export class CircularBuffer {
 
   /**
    * Returns buffer as numbers' array.
-   *
    * @returns Numbers' array.
    */
   public toArray (): number[] {
@@ -86,7 +80,6 @@ export class CircularBuffer {
 
   /**
    * Checks the buffer size.
-   *
    * @param size - Buffer size.
    */
   private checkSize (size: number): void {
index 792f23d7e1347558cfdb55d30bc1436ad848ecdf..efcc35ca67c23d89e8c5eed82c50125e3353a4d7 100644 (file)
@@ -5,7 +5,6 @@ export const defaultQueueSize = 2048
 
 /**
  * Fixed priority queue node.
- *
  * @typeParam T - Type of priority queue node data.
  * @internal
  */
@@ -16,13 +15,12 @@ export interface FixedPriorityQueueNode<T> {
 
 /**
  * Fixed priority queue.
- *
  * @typeParam T - Type of fixed priority queue data.
  * @internal
  */
 export class FixedPriorityQueue<T> {
   private start!: number
-  private readonly nodeArray: Array<FixedPriorityQueueNode<T>>
+  private readonly nodeArray: FixedPriorityQueueNode<T>[]
   /** The fixed priority queue capacity. */
   public readonly capacity: number
   /** The fixed priority queue size. */
@@ -32,7 +30,6 @@ export class FixedPriorityQueue<T> {
 
   /**
    * Constructs a fixed priority queue.
-   *
    * @param size - Fixed priority queue size. @defaultValue defaultQueueSize
    * @param enablePriority - Whether to enable priority. @defaultValue false
    * @returns FixedPriorityQueue.
@@ -47,7 +44,6 @@ export class FixedPriorityQueue<T> {
 
   /**
    * Checks if the fixed priority queue is empty.
-   *
    * @returns `true` if the fixed priority queue is empty, `false` otherwise.
    */
   public empty (): boolean {
@@ -56,7 +52,6 @@ export class FixedPriorityQueue<T> {
 
   /**
    * Checks if the fixed priority queue is full.
-   *
    * @returns `true` if the fixed priority queue is full, `false` otherwise.
    */
   public full (): boolean {
@@ -65,7 +60,6 @@ export class FixedPriorityQueue<T> {
 
   /**
    * Enqueue data into the fixed priority queue.
-   *
    * @param data - Data to enqueue.
    * @param priority - Priority of the data. Lower values have higher priority.
    * @returns The new size of the priority queue.
@@ -105,7 +99,6 @@ export class FixedPriorityQueue<T> {
 
   /**
    * Gets data from the fixed priority queue.
-   *
    * @param index - The index of the data to get.
    * @returns The data at the index or `undefined` if the fixed priority queue is empty or the index is out of bounds.
    */
@@ -122,7 +115,6 @@ export class FixedPriorityQueue<T> {
 
   /**
    * Dequeue data from the fixed priority queue.
-   *
    * @returns The dequeued data or `undefined` if the priority queue is empty.
    */
   public dequeue (): T | undefined {
@@ -148,7 +140,6 @@ export class FixedPriorityQueue<T> {
 
   /**
    * Returns an iterator for the fixed priority queue.
-   *
    * @returns An iterator for the fixed priority queue.
    * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols
    */
@@ -160,7 +151,7 @@ export class FixedPriorityQueue<T> {
         if (i >= this.size) {
           return {
             value: undefined,
-            done: true
+            done: true,
           }
         }
         const value = this.nodeArray[index].data
@@ -171,15 +162,14 @@ export class FixedPriorityQueue<T> {
         }
         return {
           value,
-          done: false
+          done: false,
         }
-      }
+      },
     }
   }
 
   /**
    * Checks the queue size.
-   *
    * @param size - Queue size.
    */
   private checkSize (size: number): void {
index 5f502d2a18c4e8cb65708010a6929f703452da0c..e779bf0c548fc16b3b2a86f79dd0f348ae8132e5 100644 (file)
@@ -1,7 +1,7 @@
 export type { CircularBuffer } from './circular-buffer.js'
 export type {
   FixedPriorityQueue,
-  FixedPriorityQueueNode
+  FixedPriorityQueueNode,
 } from './fixed-priority-queue.js'
 export type { AbstractPool } from './pools/abstract-pool.js'
 export { DynamicClusterPool } from './pools/cluster/dynamic.js'
@@ -13,7 +13,7 @@ export type {
   PoolInfo,
   PoolOptions,
   PoolType,
-  TasksQueueOptions
+  TasksQueueOptions,
 } from './pools/pool.js'
 export { PoolEvents, PoolTypes } from './pools/pool.js'
 export type {
@@ -24,11 +24,11 @@ export type {
   StrategyPolicy,
   TaskStatisticsRequirements,
   WorkerChoiceStrategy,
-  WorkerChoiceStrategyOptions
+  WorkerChoiceStrategyOptions,
 } from './pools/selection-strategies/selection-strategies-types.js'
 export {
   Measurements,
-  WorkerChoiceStrategies
+  WorkerChoiceStrategies,
 } from './pools/selection-strategies/selection-strategies-types.js'
 export type { WorkerChoiceStrategiesContext } from './pools/selection-strategies/worker-choice-strategies-context.js'
 export { DynamicThreadPool } from './pools/thread/dynamic.js'
@@ -50,7 +50,7 @@ export type {
   WorkerNodeEventDetail,
   WorkerNodeOptions,
   WorkerType,
-  WorkerUsage
+  WorkerUsage,
 } from './pools/worker.js'
 export { WorkerTypes } from './pools/worker.js'
 export type { PriorityQueue, PriorityQueueNode } from './priority-queue.js'
@@ -62,7 +62,7 @@ export type {
   TaskPerformance,
   WorkerError,
   WorkerStatistics,
-  Writable
+  Writable,
 } from './utility-types.js'
 export { availableParallelism } from './utils.js'
 export type { AbstractWorker } from './worker/abstract-worker.js'
@@ -73,12 +73,12 @@ export type {
   TaskFunctionObject,
   TaskFunctionOperationResult,
   TaskFunctions,
-  TaskSyncFunction
+  TaskSyncFunction,
 } from './worker/task-functions.js'
 export { ThreadWorker } from './worker/thread-worker.js'
 export type {
   KillBehavior,
   KillHandler,
-  WorkerOptions
+  WorkerOptions,
 } from './worker/worker-options.js'
 export { KillBehaviors } from './worker/worker-options.js'
index 8f57a9067e0967bf87dd303efabfe694b00bdbc6..c8a87251df2f5701e92c16603870fa17a30a5d38 100644 (file)
@@ -9,7 +9,7 @@ import type {
   MessageValue,
   PromiseResponseWrapper,
   Task,
-  TaskFunctionProperties
+  TaskFunctionProperties,
 } from '../utility-types.js'
 import {
   average,
@@ -23,11 +23,11 @@ import {
   median,
   min,
   round,
-  sleep
+  sleep,
 } from '../utils.js'
 import type {
   TaskFunction,
-  TaskFunctionObject
+  TaskFunctionObject,
 } from '../worker/task-functions.js'
 import { KillBehaviors } from '../worker/worker-options.js'
 import {
@@ -37,13 +37,13 @@ import {
   type PoolOptions,
   type PoolType,
   PoolTypes,
-  type TasksQueueOptions
+  type TasksQueueOptions,
 } from './pool.js'
 import {
   Measurements,
   WorkerChoiceStrategies,
   type WorkerChoiceStrategy,
-  type WorkerChoiceStrategyOptions
+  type WorkerChoiceStrategyOptions,
 } from './selection-strategies/selection-strategies-types.js'
 import { WorkerChoiceStrategiesContext } from './selection-strategies/worker-choice-strategies-context.js'
 import {
@@ -56,7 +56,7 @@ import {
   updateRunTimeWorkerUsage,
   updateTaskStatisticsWorkerUsage,
   updateWaitTimeWorkerUsage,
-  waitWorkerNodeEvents
+  waitWorkerNodeEvents,
 } from './utils.js'
 import { version } from './version.js'
 import type {
@@ -64,13 +64,12 @@ import type {
   IWorkerNode,
   WorkerInfo,
   WorkerNodeEventDetail,
-  WorkerType
+  WorkerType,
 } from './worker.js'
 import { WorkerNode } from './worker-node.js'
 
 /**
  * Base class that implements some shared logic for all poolifier pools.
- *
  * @typeParam Worker - Type of worker which manages this pool.
  * @typeParam Data - Type of data sent to the worker. This can only be structured-cloneable data.
  * @typeParam Response - Type of execution response. This can only be structured-cloneable data.
@@ -81,7 +80,7 @@ export abstract class AbstractPool<
   Response = unknown
 > implements IPool<Worker, Data, Response> {
   /** @inheritDoc */
-  public readonly workerNodes: Array<IWorkerNode<Worker, Data>> = []
+  public readonly workerNodes: IWorkerNode<Worker, Data>[] = []
 
   /** @inheritDoc */
   public emitter?: EventEmitterAsyncResource
@@ -95,19 +94,19 @@ export abstract class AbstractPool<
    */
   protected promiseResponseMap: Map<
     `${string}-${string}-${string}-${string}-${string}`,
-  PromiseResponseWrapper<Response>
+    PromiseResponseWrapper<Response>
   > = new Map<
     `${string}-${string}-${string}-${string}-${string}`,
     PromiseResponseWrapper<Response>
-    >()
+  >()
 
   /**
    * Worker choice strategies context referencing worker choice algorithms implementation.
    */
   protected workerChoiceStrategiesContext?: WorkerChoiceStrategiesContext<
-  Worker,
-  Data,
-  Response
+    Worker,
+    Data,
+    Response
   >
 
   /**
@@ -116,8 +115,8 @@ export abstract class AbstractPool<
    * - `value`: The task function object.
    */
   private readonly taskFunctions: Map<
-  string,
-  TaskFunctionObject<Data, Response>
+    string,
+    TaskFunctionObject<Data, Response>
   >
 
   /**
@@ -147,7 +146,6 @@ export abstract class AbstractPool<
 
   /**
    * Constructs a new poolifier pool.
-   *
    * @param minimumNumberOfWorkers - Minimum number of workers that this pool manages.
    * @param filePath - Path to the worker file.
    * @param opts - Options for the pool.
@@ -177,9 +175,9 @@ export abstract class AbstractPool<
       this.initEventEmitter()
     }
     this.workerChoiceStrategiesContext = new WorkerChoiceStrategiesContext<
-    Worker,
-    Data,
-    Response
+      Worker,
+      Data,
+      Response
     >(
       this,
       // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
@@ -289,7 +287,7 @@ export abstract class AbstractPool<
 
   private initEventEmitter (): void {
     this.emitter = new EventEmitterAsyncResource({
-      name: `poolifier:${this.type}-${this.worker}-pool`
+      name: `poolifier:${this.type}-${this.worker}-pool`,
     })
   }
 
@@ -310,7 +308,7 @@ export abstract class AbstractPool<
         .runTime.aggregate === true &&
         this.workerChoiceStrategiesContext.getTaskStatisticsRequirements()
           .waitTime.aggregate && {
-        utilization: round(this.utilization)
+        utilization: round(this.utilization),
       }),
       workerNodes: this.workerNodes.length,
       idleWorkerNodes: this.workerNodes.reduce(
@@ -325,7 +323,7 @@ export abstract class AbstractPool<
           (accumulator, workerNode) =>
             workerNode.info.stealing ? accumulator + 1 : accumulator,
           0
-        )
+        ),
       }),
       busyWorkerNodes: this.workerNodes.reduce(
         (accumulator, _, workerNodeKey) =>
@@ -347,24 +345,24 @@ export abstract class AbstractPool<
           (accumulator, workerNode) =>
             accumulator + workerNode.usage.tasks.queued,
           0
-        )
+        ),
       }),
       ...(this.opts.enableTasksQueue === true && {
         maxQueuedTasks: this.workerNodes.reduce(
           (accumulator, workerNode) =>
             accumulator + (workerNode.usage.tasks.maxQueued ?? 0),
           0
-        )
+        ),
       }),
       ...(this.opts.enableTasksQueue === true && {
-        backPressure: this.hasBackPressure()
+        backPressure: this.hasBackPressure(),
       }),
       ...(this.opts.enableTasksQueue === true && {
         stolenTasks: this.workerNodes.reduce(
           (accumulator, workerNode) =>
             accumulator + workerNode.usage.tasks.stolen,
           0
-        )
+        ),
       }),
       failedTasks: this.workerNodes.reduce(
         (accumulator, workerNode) =>
@@ -402,7 +400,7 @@ export abstract class AbstractPool<
                   []
                 )
               )
-            )
+            ),
           }),
           ...(this.workerChoiceStrategiesContext.getTaskStatisticsRequirements()
             .runTime.median && {
@@ -416,9 +414,9 @@ export abstract class AbstractPool<
                   []
                 )
               )
-            )
-          })
-        }
+            ),
+          }),
+        },
       }),
       ...(this.workerChoiceStrategiesContext?.getTaskStatisticsRequirements()
         .waitTime.aggregate === true && {
@@ -451,7 +449,7 @@ export abstract class AbstractPool<
                   []
                 )
               )
-            )
+            ),
           }),
           ...(this.workerChoiceStrategiesContext.getTaskStatisticsRequirements()
             .waitTime.median && {
@@ -465,9 +463,9 @@ export abstract class AbstractPool<
                   []
                 )
               )
-            )
-          })
-        }
+            ),
+          }),
+        },
       }),
       ...(this.workerChoiceStrategiesContext?.getTaskStatisticsRequirements()
         .elu.aggregate === true && {
@@ -503,7 +501,7 @@ export abstract class AbstractPool<
                     []
                   )
                 )
-              )
+              ),
             }),
             ...(this.workerChoiceStrategiesContext.getTaskStatisticsRequirements()
               .elu.median && {
@@ -517,8 +515,8 @@ export abstract class AbstractPool<
                     []
                   )
                 )
-              )
-            })
+              ),
+            }),
           },
           active: {
             minimum: round(
@@ -551,7 +549,7 @@ export abstract class AbstractPool<
                     []
                   )
                 )
-              )
+              ),
             }),
             ...(this.workerChoiceStrategiesContext.getTaskStatisticsRequirements()
               .elu.median && {
@@ -565,8 +563,8 @@ export abstract class AbstractPool<
                     []
                   )
                 )
-              )
-            })
+              ),
+            }),
           },
           utilization: {
             average: round(
@@ -582,10 +580,10 @@ export abstract class AbstractPool<
                   workerNode => workerNode.usage.elu.utilization ?? 0
                 )
               )
-            )
-          }
-        }
-      })
+            ),
+          },
+        },
+      }),
     }
   }
 
@@ -616,7 +614,6 @@ export abstract class AbstractPool<
 
   /**
    * The approximate pool utilization.
-   *
    * @returns The pool utilization.
    */
   private get utilization (): number {
@@ -653,7 +650,6 @@ export abstract class AbstractPool<
 
   /**
    * Checks if the worker id sent in the received message from a worker is valid.
-   *
    * @param message - The received message.
    * @throws {@link https://nodejs.org/api/errors.html#class-error} If the worker id is invalid.
    */
@@ -669,7 +665,6 @@ export abstract class AbstractPool<
 
   /**
    * Gets the worker node key given its worker id.
-   *
    * @param workerId - The worker id.
    * @returns The worker node key if the worker id is found in the pool worker nodes, `-1` otherwise.
    */
@@ -780,7 +775,7 @@ export abstract class AbstractPool<
       ...getDefaultTasksQueueOptions(
         this.maximumNumberOfWorkers ?? this.minimumNumberOfWorkers
       ),
-      ...tasksQueueOptions
+      ...tasksQueueOptions,
     }
   }
 
@@ -844,7 +839,6 @@ export abstract class AbstractPool<
 
   /**
    * Whether worker nodes are executing concurrently their tasks quota or not.
-   *
    * @returns Worker nodes busyness boolean status.
    */
   protected internalBusy (): boolean {
@@ -997,7 +991,7 @@ export abstract class AbstractPool<
     const opResult = await this.sendTaskFunctionOperationToWorkers({
       taskFunctionOperation: 'add',
       taskFunctionProperties: buildTaskFunctionProperties(name, fn),
-      taskFunction: fn.taskFunction.toString()
+      taskFunction: fn.taskFunction.toString(),
     })
     this.taskFunctions.set(name, fn)
     this.workerChoiceStrategiesContext?.syncWorkerChoiceStrategies(
@@ -1021,7 +1015,7 @@ export abstract class AbstractPool<
       taskFunctionProperties: buildTaskFunctionProperties(
         name,
         this.taskFunctions.get(name)
-      )
+      ),
     })
     for (const workerNode of this.workerNodes) {
       workerNode.deleteTaskFunctionWorkerUsage(name)
@@ -1051,7 +1045,6 @@ export abstract class AbstractPool<
 
   /**
    * Gets task function worker choice strategy, if any.
-   *
    * @param name - The task function name.
    * @returns The task function worker choice strategy if the task function worker choice strategy is defined, `undefined` otherwise.
    */
@@ -1071,7 +1064,6 @@ export abstract class AbstractPool<
 
   /**
    * Gets worker node task function worker choice strategy, if any.
-   *
    * @param workerNodeKey - The worker node key.
    * @param name - The task function name.
    * @returns The worker node task function worker choice strategy if the worker node task function worker choice strategy is defined, `undefined` otherwise.
@@ -1096,7 +1088,6 @@ export abstract class AbstractPool<
 
   /**
    * Gets worker node task function priority, if any.
-   *
    * @param workerNodeKey - The worker node key.
    * @param name - The task function name.
    * @returns The worker node task function priority if the worker node task function priority is defined, `undefined` otherwise.
@@ -1121,7 +1112,6 @@ export abstract class AbstractPool<
 
   /**
    * Gets the worker choice strategies registered in this pool.
-   *
    * @returns The worker choice strategies.
    */
   private readonly getWorkerChoiceStrategies =
@@ -1136,7 +1126,7 @@ export abstract class AbstractPool<
           )
           .filter(
             (strategy: WorkerChoiceStrategy | undefined) => strategy != null
-          ) as WorkerChoiceStrategy[])
+          ) as WorkerChoiceStrategy[]),
       ])
     }
 
@@ -1147,7 +1137,7 @@ export abstract class AbstractPool<
       taskFunctionProperties: buildTaskFunctionProperties(
         name,
         this.taskFunctions.get(name)
-      )
+      ),
     })
   }
 
@@ -1195,7 +1185,7 @@ export abstract class AbstractPool<
       const workerNodeKey = this.chooseWorkerNode(name)
       const task: Task<Data> = {
         name: name ?? DEFAULT_TASK_NAME,
-        // eslint-disable-next-line @typescript-eslint/consistent-type-assertions
+
         data: data ?? ({} as Data),
         priority: this.getWorkerNodeTaskFunctionPriority(workerNodeKey, name),
         strategy: this.getWorkerNodeTaskFunctionWorkerChoiceStrategy(
@@ -1204,7 +1194,7 @@ export abstract class AbstractPool<
         ),
         transferList,
         timestamp,
-        taskId: randomUUID()
+        taskId: randomUUID(),
       }
       // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
       this.promiseResponseMap.set(task.taskId!, {
@@ -1214,9 +1204,9 @@ export abstract class AbstractPool<
         ...(this.emitter != null && {
           asyncResource: new AsyncResource('poolifier:task', {
             triggerAsyncId: this.emitter.asyncId,
-            requireManualDestroy: true
-          })
-        })
+            requireManualDestroy: true,
+          }),
+        }),
       })
       if (
         this.opts.enableTasksQueue === false ||
@@ -1232,6 +1222,7 @@ export abstract class AbstractPool<
 
   /**
    * Starts the minimum number of workers.
+   * @param initWorkerNodeUsage
    */
   private startMinimumNumberOfWorkers (initWorkerNodeUsage = false): void {
     this.startingMinimumNumberOfWorkers = true
@@ -1294,7 +1285,6 @@ export abstract class AbstractPool<
 
   private async sendKillMessageToWorker (workerNodeKey: number): Promise<void> {
     await new Promise<void>((resolve, reject) => {
-      // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
       if (this.workerNodes[workerNodeKey] == null) {
         resolve()
         return
@@ -1319,7 +1309,6 @@ export abstract class AbstractPool<
 
   /**
    * Terminates the worker node given its worker node key.
-   *
    * @param workerNodeKey - The worker node key.
    */
   protected async destroyWorkerNode (workerNodeKey: number): Promise<void> {
@@ -1342,8 +1331,6 @@ export abstract class AbstractPool<
   /**
    * Setup hook to execute code before worker nodes are created in the abstract constructor.
    * Can be overridden.
-   *
-   * @virtual
    */
   protected setupHook (): void {
     /* Intentionally empty */
@@ -1351,7 +1338,6 @@ export abstract class AbstractPool<
 
   /**
    * Returns whether the worker is the main worker or not.
-   *
    * @returns `true` if the worker is the main worker, `false` otherwise.
    */
   protected abstract isMain (): boolean
@@ -1359,7 +1345,6 @@ export abstract class AbstractPool<
   /**
    * Hook executed before the worker task execution.
    * Can be overridden.
-   *
    * @param workerNodeKey - The worker node key.
    * @param task - The task to execute.
    */
@@ -1367,7 +1352,6 @@ export abstract class AbstractPool<
     workerNodeKey: number,
     task: Task<Data>
   ): void {
-    // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
     if (this.workerNodes[workerNodeKey]?.usage != null) {
       const workerUsage = this.workerNodes[workerNodeKey].usage
       ++workerUsage.tasks.executing
@@ -1400,7 +1384,6 @@ export abstract class AbstractPool<
   /**
    * Hook executed after the worker task execution.
    * Can be overridden.
-   *
    * @param workerNodeKey - The worker node key.
    * @param message - The received message.
    */
@@ -1409,7 +1392,7 @@ export abstract class AbstractPool<
     message: MessageValue<Response>
   ): void {
     let needWorkerChoiceStrategiesUpdate = false
-    // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
+
     if (this.workerNodes[workerNodeKey]?.usage != null) {
       const workerUsage = this.workerNodes[workerNodeKey].usage
       updateTaskStatisticsWorkerUsage(workerUsage, message)
@@ -1457,7 +1440,6 @@ export abstract class AbstractPool<
 
   /**
    * Whether the worker node shall update its task function worker usage or not.
-   *
    * @param workerNodeKey - The worker node key.
    * @returns `true` if the worker node shall update its task function worker usage, `false` otherwise.
    */
@@ -1472,7 +1454,6 @@ export abstract class AbstractPool<
 
   /**
    * Chooses a worker node for the next task.
-   *
    * @param name - The task function name.
    * @returns The chosen worker node key.
    */
@@ -1494,14 +1475,12 @@ export abstract class AbstractPool<
 
   /**
    * Conditions for dynamic worker creation.
-   *
    * @returns Whether to create a dynamic worker or not.
    */
   protected abstract shallCreateDynamicWorker (): boolean
 
   /**
    * Sends a message to worker given its worker node key.
-   *
    * @param workerNodeKey - The worker node key.
    * @param message - The message.
    * @param transferList - The optional array of transferable objects.
@@ -1514,7 +1493,6 @@ export abstract class AbstractPool<
 
   /**
    * Initializes the worker node usage with sensible default values gathered during runtime.
-   *
    * @param workerNode - The worker node.
    */
   private initWorkerNodeUsage (workerNode: IWorkerNode<Worker, Data>): void {
@@ -1555,7 +1533,6 @@ export abstract class AbstractPool<
 
   /**
    * Creates a new, completely set up worker node.
-   *
    * @returns New, completely set up worker node key.
    */
   protected createAndSetupWorkerNode (): number {
@@ -1593,7 +1570,7 @@ export abstract class AbstractPool<
       ) {
         this.redistributeQueuedTasks(this.workerNodes.indexOf(workerNode))
       }
-      // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
+
       workerNode?.terminate().catch((error: unknown) => {
         this.emitter?.emit(PoolEvents.error, error)
       })
@@ -1619,7 +1596,6 @@ export abstract class AbstractPool<
 
   /**
    * Creates a new, completely set up dynamic worker node.
-   *
    * @returns New, completely set up dynamic worker node key.
    */
   protected createAndSetupDynamicWorkerNode (): number {
@@ -1651,7 +1627,7 @@ export abstract class AbstractPool<
       }
     })
     this.sendToWorker(workerNodeKey, {
-      checkActive: true
+      checkActive: true,
     })
     if (this.taskFunctions.size > 0) {
       for (const [taskFunctionName, taskFunctionObject] of this.taskFunctions) {
@@ -1661,7 +1637,7 @@ export abstract class AbstractPool<
             taskFunctionName,
             taskFunctionObject
           ),
-          taskFunction: taskFunctionObject.taskFunction.toString()
+          taskFunction: taskFunctionObject.taskFunction.toString(),
         }).catch((error: unknown) => {
           this.emitter?.emit(PoolEvents.error, error)
         })
@@ -1684,7 +1660,6 @@ export abstract class AbstractPool<
 
   /**
    * Registers a listener callback on the worker given its worker node key.
-   *
    * @param workerNodeKey - The worker node key.
    * @param listener - The message listener callback.
    */
@@ -1697,7 +1672,6 @@ export abstract class AbstractPool<
 
   /**
    * Registers once a listener callback on the worker given its worker node key.
-   *
    * @param workerNodeKey - The worker node key.
    * @param listener - The message listener callback.
    */
@@ -1710,7 +1684,6 @@ export abstract class AbstractPool<
 
   /**
    * Deregisters a listener callback on the worker given its worker node key.
-   *
    * @param workerNodeKey - The worker node key.
    * @param listener - The message listener callback.
    */
@@ -1724,7 +1697,6 @@ export abstract class AbstractPool<
   /**
    * Method hooked up after a worker node has been newly created.
    * Can be overridden.
-   *
    * @param workerNodeKey - The newly created worker node key.
    */
   protected afterWorkerNodeSetup (workerNodeKey: number): void {
@@ -1755,14 +1727,12 @@ export abstract class AbstractPool<
 
   /**
    * Sends the startup message to worker given its worker node key.
-   *
    * @param workerNodeKey - The worker node key.
    */
   protected abstract sendStartupMessageToWorker (workerNodeKey: number): void
 
   /**
    * Sends the statistics message to worker given its worker node key.
-   *
    * @param workerNodeKey - The worker node key.
    */
   private sendStatisticsMessageToWorker (workerNodeKey: number): void {
@@ -1773,8 +1743,8 @@ export abstract class AbstractPool<
             .runTime.aggregate ?? false,
         elu:
           this.workerChoiceStrategiesContext?.getTaskStatisticsRequirements()
-            .elu.aggregate ?? false
-      }
+            .elu.aggregate ?? false,
+      },
     })
   }
 
@@ -1819,7 +1789,7 @@ export abstract class AbstractPool<
     taskName: string
   ): void {
     const workerNode = this.workerNodes[workerNodeKey]
-    // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
+
     if (workerNode?.usage != null) {
       ++workerNode.usage.tasks.stolen
     }
@@ -1838,7 +1808,7 @@ export abstract class AbstractPool<
     previousTaskName?: string
   ): void {
     const workerNode = this.workerNodes[workerNodeKey]
-    // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
+
     if (workerNode?.usage != null) {
       ++workerNode.usage.tasks.sequentiallyStolen
     }
@@ -1867,7 +1837,7 @@ export abstract class AbstractPool<
     taskName: string
   ): void {
     const workerNode = this.workerNodes[workerNodeKey]
-    // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
+
     if (workerNode?.usage != null) {
       workerNode.usage.tasks.sequentiallyStolen = 0
     }
@@ -2033,6 +2003,7 @@ export abstract class AbstractPool<
 
   /**
    * This method is the message listener registered on each worker.
+   * @param message
    */
   protected readonly workerMessageListener = (
     message: MessageValue<Response>
@@ -2103,12 +2074,10 @@ export abstract class AbstractPool<
       this.afterTaskExecutionHook(workerNodeKey, message)
       // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
       this.promiseResponseMap.delete(taskId!)
-      // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
       workerNode?.emit('taskFinished', taskId)
       if (
         this.opts.enableTasksQueue === true &&
         !this.destroying &&
-        // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
         workerNode != null
       ) {
         const workerNodeTasksUsage = workerNode.usage.tasks
@@ -2128,7 +2097,7 @@ export abstract class AbstractPool<
         ) {
           workerNode.emit('idle', {
             workerId,
-            workerNodeKey
+            workerNodeKey,
           })
         }
       }
@@ -2154,7 +2123,6 @@ export abstract class AbstractPool<
 
   /**
    * Gets the worker information given its worker node key.
-   *
    * @param workerNodeKey - The worker node key.
    * @returns The worker information.
    */
@@ -2170,7 +2138,6 @@ export abstract class AbstractPool<
 
   /**
    * Creates a worker node.
-   *
    * @returns The created worker node.
    */
   private createWorkerNode (): IWorkerNode<Worker, Data> {
@@ -2186,7 +2153,7 @@ export abstract class AbstractPool<
             this.maximumNumberOfWorkers ?? this.minimumNumberOfWorkers
           ).size,
         tasksQueueBucketSize: defaultBucketSize,
-        tasksQueuePriority: this.getTasksQueuePriority()
+        tasksQueuePriority: this.getTasksQueuePriority(),
       }
     )
     // Flag the worker node as ready at pool startup.
@@ -2198,7 +2165,6 @@ export abstract class AbstractPool<
 
   /**
    * Adds the given worker node in the pool worker nodes.
-   *
    * @param workerNode - The worker node.
    * @returns The added worker node key.
    * @throws {@link https://nodejs.org/api/errors.html#class-error} If the added worker node is not found.
@@ -2221,7 +2187,6 @@ export abstract class AbstractPool<
 
   /**
    * Removes the worker node from the pool worker nodes.
-   *
    * @param workerNode - The worker node.
    */
   private removeWorkerNode (workerNode: IWorkerNode<Worker, Data>): void {
@@ -2251,7 +2216,6 @@ export abstract class AbstractPool<
 
   /**
    * Executes the given task on the worker given its worker node key.
-   *
    * @param workerNodeKey - The worker node key.
    * @param task - The task to execute.
    */
index 51d1cbeece56d374df9228cbee9dbdfed86f1989..47799f5ef6352cd6f3f2fbe68b4545fb67ab420b 100644 (file)
@@ -7,7 +7,6 @@ import { type ClusterPoolOptions, FixedClusterPool } from './fixed.js'
  *
  * This cluster pool creates new workers when the others are busy, up to the maximum number of workers.
  * When the maximum number of workers is reached and workers are busy, an event is emitted. If you want to listen to this event, use the pool's `emitter`.
- *
  * @typeParam Data - Type of data sent to the worker. This can only be structured-cloneable data.
  * @typeParam Response - Type of execution response. This can only be structured-cloneable data.
  * @author [Christopher Quadflieg](https://github.com/Shinigami92)
@@ -19,7 +18,6 @@ export class DynamicClusterPool<
 > extends FixedClusterPool<Data, Response> {
   /**
    * Constructs a new poolifier dynamic cluster pool.
-   *
    * @param min - Minimum number of workers which are always active.
    * @param max - Maximum number of workers that can be created by this pool.
    * @param filePath - Path to an implementation of a `ClusterWorker` file, which can be relative or absolute.
index 4a8cb4f1eeeafeb59adf1e30c5d678328cb19b70..51a891bf53259db5df60de46b8f4acfef80ad775 100644 (file)
@@ -12,7 +12,6 @@ export type ClusterPoolOptions = PoolOptions<Worker>
 
 /**
  * A cluster pool with a fixed number of workers.
- *
  * @typeParam Data - Type of data sent to the worker. This can only be structured-cloneable data.
  * @typeParam Response - Type of execution response. This can only be structured-cloneable data.
  * @author [Christopher Quadflieg](https://github.com/Shinigami92)
@@ -24,10 +23,10 @@ export class FixedClusterPool<
 > extends AbstractPool<Worker, Data, Response> {
   /**
    * Constructs a new poolifier fixed cluster pool.
-   *
    * @param numberOfWorkers - Number of workers for this pool.
    * @param filePath - Path to an implementation of a `ClusterWorker` file, which can be relative or absolute.
    * @param opts - Options for this fixed cluster pool.
+   * @param maximumNumberOfWorkers
    */
   public constructor (
     numberOfWorkers: number,
@@ -55,14 +54,14 @@ export class FixedClusterPool<
   ): void {
     this.workerNodes[workerNodeKey]?.worker.send({
       ...message,
-      workerId: this.getWorkerInfo(workerNodeKey)?.id
+      workerId: this.getWorkerInfo(workerNodeKey)?.id,
     } satisfies MessageValue<Data>)
   }
 
   /** @inheritDoc */
   protected sendStartupMessageToWorker (workerNodeKey: number): void {
     this.sendToWorker(workerNodeKey, {
-      ready: false
+      ready: false,
     })
   }
 
index a025f3ced9568eb872957b98d060ce66ef27ad10..c2d5498753c61a385fa43bb2a68163b305ad03a2 100644 (file)
@@ -5,11 +5,11 @@ import type { TransferListItem, WorkerOptions } from 'node:worker_threads'
 import type { TaskFunctionProperties } from '../utility-types.js'
 import type {
   TaskFunction,
-  TaskFunctionObject
+  TaskFunctionObject,
 } from '../worker/task-functions.js'
 import type {
   WorkerChoiceStrategy,
-  WorkerChoiceStrategyOptions
+  WorkerChoiceStrategyOptions,
 } from './selection-strategies/selection-strategies-types.js'
 import type {
   ErrorHandler,
@@ -18,7 +18,7 @@ import type {
   IWorkerNode,
   MessageHandler,
   OnlineHandler,
-  WorkerType
+  WorkerType,
 } from './worker.js'
 
 /**
@@ -35,7 +35,7 @@ export const PoolTypes: Readonly<{
   /**
    * Dynamic pool type.
    */
-  dynamic: 'dynamic'
+  dynamic: 'dynamic',
 } as const)
 
 /**
@@ -63,7 +63,7 @@ export const PoolEvents: Readonly<{
   destroy: 'destroy',
   error: 'error',
   taskError: 'taskError',
-  backPressure: 'backPressure'
+  backPressure: 'backPressure',
 } as const)
 
 /**
@@ -139,31 +139,26 @@ export interface PoolInfo {
 export interface TasksQueueOptions {
   /**
    * Maximum tasks queue size per worker node flagging it as back pressured.
-   *
    * @defaultValue (pool maximum size)^2
    */
   readonly size?: number
   /**
    * Maximum number of tasks that can be executed concurrently on a worker node.
-   *
    * @defaultValue 1
    */
   readonly concurrency?: number
   /**
    * Whether to enable task stealing on idle.
-   *
    * @defaultValue true
    */
   readonly taskStealing?: boolean
   /**
    * Whether to enable tasks stealing under back pressure.
-   *
    * @defaultValue false
    */
   readonly tasksStealingOnBackPressure?: boolean
   /**
    * Queued tasks finished timeout in milliseconds at worker node termination.
-   *
    * @defaultValue 2000
    */
   readonly tasksFinishedTimeout?: number
@@ -171,43 +166,36 @@ export interface TasksQueueOptions {
 
 /**
  * Options for a poolifier pool.
- *
  * @typeParam Worker - Type of worker.
  */
 export interface PoolOptions<Worker extends IWorker> {
   /**
    * A function that will listen for online event on each worker.
-   *
    * @defaultValue `() => {}`
    */
   onlineHandler?: OnlineHandler<Worker>
   /**
    * A function that will listen for message event on each worker.
-   *
    * @defaultValue `() => {}`
    */
   messageHandler?: MessageHandler<Worker>
   /**
    * A function that will listen for error event on each worker.
-   *
    * @defaultValue `() => {}`
    */
   errorHandler?: ErrorHandler<Worker>
   /**
    * A function that will listen for exit event on each worker.
-   *
    * @defaultValue `() => {}`
    */
   exitHandler?: ExitHandler<Worker>
   /**
    * Whether to start the minimum number of workers at pool initialization.
-   *
    * @defaultValue true
    */
   startWorkers?: boolean
   /**
    * The default worker choice strategy to use in this pool.
-   *
    * @defaultValue WorkerChoiceStrategies.ROUND_ROBIN
    */
   workerChoiceStrategy?: WorkerChoiceStrategy
@@ -221,13 +209,11 @@ export interface PoolOptions<Worker extends IWorker> {
   restartWorkerOnError?: boolean
   /**
    * Pool events integrated with async resource emission.
-   *
    * @defaultValue true
    */
   enableEvents?: boolean
   /**
    * Pool worker node tasks queue.
-   *
    * @defaultValue false
    */
   enableTasksQueue?: boolean
@@ -237,19 +223,16 @@ export interface PoolOptions<Worker extends IWorker> {
   tasksQueueOptions?: TasksQueueOptions
   /**
    * Worker options.
-   *
    * @see https://nodejs.org/api/worker_threads.html#new-workerfilename-options
    */
   workerOptions?: WorkerOptions
   /**
    * Key/value pairs to add to worker process environment.
-   *
    * @see https://nodejs.org/api/cluster.html#cluster_cluster_fork_env
    */
   env?: Record<string, unknown>
   /**
    * Cluster settings.
-   *
    * @see https://nodejs.org/api/cluster.html#cluster_cluster_settings
    */
   settings?: ClusterSettings
@@ -257,7 +240,6 @@ export interface PoolOptions<Worker extends IWorker> {
 
 /**
  * Contract definition for a poolifier pool.
- *
  * @typeParam Worker - Type of worker which manages this pool.
  * @typeParam Data - Type of data sent to the worker. This can only be structured-cloneable data.
  * @typeParam Response - Type of execution response. This can only be structured-cloneable data.
@@ -273,10 +255,9 @@ export interface IPool<
   readonly info: PoolInfo
   /**
    * Pool worker nodes.
-   *
    * @internal
    */
-  readonly workerNodes: Array<IWorkerNode<Worker, Data>>
+  readonly workerNodes: IWorkerNode<Worker, Data>[]
   /**
    * Pool event emitter integrated with async resource.
    * The async tracking tooling identifier is `poolifier:<PoolType>-<WorkerType>-pool`.
@@ -295,7 +276,6 @@ export interface IPool<
   readonly emitter?: EventEmitterAsyncResource
   /**
    * Executes the specified function in the worker constructor with the task data input parameter.
-   *
    * @param data - The optional task input data for the specified task function. This can only be structured-cloneable data.
    * @param name - The optional name of the task function to execute. If not specified, the default task function will be executed.
    * @param transferList - An optional array of transferable objects to transfer ownership of. Ownership of the transferred objects is given to the chosen pool's worker_threads worker and they should not be used in the main thread afterwards.
@@ -316,7 +296,6 @@ export interface IPool<
   readonly destroy: () => Promise<void>
   /**
    * Whether the specified task function exists in this pool.
-   *
    * @param name - The name of the task function.
    * @returns `true` if the task function exists, `false` otherwise.
    */
@@ -324,7 +303,6 @@ export interface IPool<
   /**
    * Adds a task function to this pool.
    * If a task function with the same name already exists, it will be overwritten.
-   *
    * @param name - The name of the task function.
    * @param fn - The task function.
    * @returns `true` if the task function was added, `false` otherwise.
@@ -337,27 +315,23 @@ export interface IPool<
   ) => Promise<boolean>
   /**
    * Removes a task function from this pool.
-   *
    * @param name - The name of the task function.
    * @returns `true` if the task function was removed, `false` otherwise.
    */
   readonly removeTaskFunction: (name: string) => Promise<boolean>
   /**
    * Lists the properties of task functions available in this pool.
-   *
    * @returns The properties of task functions available in this pool.
    */
   readonly listTaskFunctionsProperties: () => TaskFunctionProperties[]
   /**
    * Sets the default task function in this pool.
-   *
    * @param name - The name of the task function.
    * @returns `true` if the default task function was set, `false` otherwise.
    */
   readonly setDefaultTaskFunction: (name: string) => Promise<boolean>
   /**
    * Sets the default worker choice strategy in this pool.
-   *
    * @param workerChoiceStrategy - The default worker choice strategy.
    * @param workerChoiceStrategyOptions - The worker choice strategy options.
    */
@@ -367,7 +341,6 @@ export interface IPool<
   ) => void
   /**
    * Sets the worker choice strategy options in this pool.
-   *
    * @param workerChoiceStrategyOptions - The worker choice strategy options.
    * @returns `true` if the worker choice strategy options were set, `false` otherwise.
    */
@@ -376,7 +349,6 @@ export interface IPool<
   ) => boolean
   /**
    * Enables/disables the worker node tasks queue in this pool.
-   *
    * @param enable - Whether to enable or disable the worker node tasks queue.
    * @param tasksQueueOptions - The worker node tasks queue options.
    */
@@ -386,7 +358,6 @@ export interface IPool<
   ) => void
   /**
    * Sets the worker node tasks queue options in this pool.
-   *
    * @param tasksQueueOptions - The worker node tasks queue options.
    */
   readonly setTasksQueueOptions: (tasksQueueOptions: TasksQueueOptions) => void
index 2b40f0c6de497a630808fbffe6a9ec3f59039e91..f4273dcd9d17bc3e20f56795f0891a0dbf4b2d56 100644 (file)
@@ -5,16 +5,15 @@ import type {
   IWorkerChoiceStrategy,
   StrategyPolicy,
   TaskStatisticsRequirements,
-  WorkerChoiceStrategyOptions
+  WorkerChoiceStrategyOptions,
 } from './selection-strategies-types.js'
 import {
   buildWorkerChoiceStrategyOptions,
-  toggleMedianMeasurementStatisticsRequirements
+  toggleMedianMeasurementStatisticsRequirements,
 } from './selection-strategies-utils.js'
 
 /**
  * Worker choice strategy abstract base class.
- *
  * @typeParam Worker - Type of worker which manages the strategy.
  * @typeParam Data - Type of data sent to the worker. This can only be structured-cloneable data.
  * @typeParam Response - Type of execution response. This can only be structured-cloneable data.
@@ -37,19 +36,18 @@ export abstract class AbstractWorkerChoiceStrategy<
   /** @inheritDoc */
   public readonly strategyPolicy: StrategyPolicy = {
     dynamicWorkerUsage: false,
-    dynamicWorkerReady: true
+    dynamicWorkerReady: true,
   }
 
   /** @inheritDoc */
   public readonly taskStatisticsRequirements: TaskStatisticsRequirements = {
     runTime: DEFAULT_MEASUREMENT_STATISTICS_REQUIREMENTS,
     waitTime: DEFAULT_MEASUREMENT_STATISTICS_REQUIREMENTS,
-    elu: DEFAULT_MEASUREMENT_STATISTICS_REQUIREMENTS
+    elu: DEFAULT_MEASUREMENT_STATISTICS_REQUIREMENTS,
   }
 
   /**
    * Constructs a worker choice strategy bound to the pool.
-   *
    * @param pool - The pool instance.
    * @param opts - The worker choice strategy options.
    */
@@ -109,7 +107,6 @@ export abstract class AbstractWorkerChoiceStrategy<
 
   /**
    * Whether the worker node is ready or not.
-   *
    * @param workerNodeKey - The worker node key.
    * @returns Whether the worker node is ready or not.
    */
@@ -134,7 +131,6 @@ export abstract class AbstractWorkerChoiceStrategy<
    * Gets the worker node task runtime.
    * If the task statistics require the average runtime, the average runtime is returned.
    * If the task statistics require the median runtime, the median runtime is returned.
-   *
    * @param workerNodeKey - The worker node key.
    * @returns The worker node task runtime.
    */
@@ -148,7 +144,6 @@ export abstract class AbstractWorkerChoiceStrategy<
    * Gets the worker node task wait time.
    * If the task statistics require the average wait time, the average wait time is returned.
    * If the task statistics require the median wait time, the median wait time is returned.
-   *
    * @param workerNodeKey - The worker node key.
    * @returns The worker node task wait time.
    */
@@ -162,7 +157,6 @@ export abstract class AbstractWorkerChoiceStrategy<
    * Gets the worker node task ELU.
    * If the task statistics require the average ELU, the average ELU is returned.
    * If the task statistics require the median ELU, the median ELU is returned.
-   *
    * @param workerNodeKey - The worker node key.
    * @returns The worker node task ELU.
    */
@@ -174,7 +168,6 @@ export abstract class AbstractWorkerChoiceStrategy<
 
   /**
    * Sets safely the previous worker node key.
-   *
    * @param workerNodeKey - The worker node key.
    */
   protected setPreviousWorkerNodeKey (workerNodeKey: number | undefined): void {
index d1a4919d70184950dcacdf4596db552579bc9fb1..88e12b94fa8ef50b50ede22026e95f0242000d45 100644 (file)
@@ -5,13 +5,12 @@ import {
   type IWorkerChoiceStrategy,
   Measurements,
   type TaskStatisticsRequirements,
-  type WorkerChoiceStrategyOptions
+  type WorkerChoiceStrategyOptions,
 } from './selection-strategies-types.js'
 
 /**
  * Selects the next worker with a fair share scheduling algorithm.
  * Loosely modeled after the fair queueing algorithm: https://en.wikipedia.org/wiki/Fair_queuing.
- *
  * @typeParam Worker - Type of worker which manages the strategy.
  * @typeParam Data - Type of data sent to the worker. This can only be structured-cloneable data.
  * @typeParam Response - Type of execution response. This can only be structured-cloneable data.
@@ -28,18 +27,18 @@ export class FairShareWorkerChoiceStrategy<
     runTime: {
       aggregate: true,
       average: true,
-      median: false
+      median: false,
     },
     waitTime: {
       aggregate: true,
       average: true,
-      median: false
+      median: false,
     },
     elu: {
       aggregate: true,
       average: true,
-      median: false
-    }
+      median: false,
+    },
   }
 
   /** @inheritDoc */
@@ -63,7 +62,7 @@ export class FairShareWorkerChoiceStrategy<
   public update (workerNodeKey: number): boolean {
     this.pool.workerNodes[workerNodeKey].strategyData = {
       virtualTaskEndTimestamp:
-        this.computeWorkerNodeVirtualTaskEndTimestamp(workerNodeKey)
+        this.computeWorkerNodeVirtualTaskEndTimestamp(workerNodeKey),
     }
     return true
   }
@@ -86,7 +85,7 @@ export class FairShareWorkerChoiceStrategy<
         if (workerNode.strategyData?.virtualTaskEndTimestamp == null) {
           workerNode.strategyData = {
             virtualTaskEndTimestamp:
-              this.computeWorkerNodeVirtualTaskEndTimestamp(workerNodeKey)
+              this.computeWorkerNodeVirtualTaskEndTimestamp(workerNodeKey),
           }
         }
         return this.isWorkerNodeReady(workerNodeKey) &&
@@ -103,7 +102,6 @@ export class FairShareWorkerChoiceStrategy<
 
   /**
    * Computes the worker node key virtual task end timestamp.
-   *
    * @param workerNodeKey - The worker node key.
    * @returns The worker node key virtual task end timestamp.
    */
index 4048924c5f9e4b86e72c42697d06a15e271aa08b..61dd2cff38f2c0337c6b3b20706fe209ffc27021 100644 (file)
@@ -5,12 +5,11 @@ import { AbstractWorkerChoiceStrategy } from './abstract-worker-choice-strategy.
 import type {
   IWorkerChoiceStrategy,
   TaskStatisticsRequirements,
-  WorkerChoiceStrategyOptions
+  WorkerChoiceStrategyOptions,
 } from './selection-strategies-types.js'
 
 /**
  * Selects the next worker with an interleaved weighted round robin scheduling algorithm.
- *
  * @typeParam Worker - Type of worker which manages the strategy.
  * @typeParam Data - Type of data sent to the worker. This can only be structured-cloneable data.
  * @typeParam Response - Type of execution response. This can only be structured-cloneable data.
@@ -27,14 +26,14 @@ export class InterleavedWeightedRoundRobinWorkerChoiceStrategy<
     runTime: {
       aggregate: true,
       average: true,
-      median: false
+      median: false,
     },
     waitTime: {
       aggregate: true,
       average: true,
-      median: false
+      median: false,
     },
-    elu: DEFAULT_MEASUREMENT_STATISTICS_REQUIREMENTS
+    elu: DEFAULT_MEASUREMENT_STATISTICS_REQUIREMENTS,
   }
 
   /**
@@ -170,7 +169,7 @@ export class InterleavedWeightedRoundRobinWorkerChoiceStrategy<
         Object.values(this.opts!.weights!)
           .slice()
           .sort((a, b) => a - b)
-      )
+      ),
     ]
   }
 }
index b07a9d1cafe223b642c8dd337cb986d4ea918272..33199368c67b176a23920f407973aaf290e3a9be 100644 (file)
@@ -5,12 +5,11 @@ import { AbstractWorkerChoiceStrategy } from './abstract-worker-choice-strategy.
 import type {
   IWorkerChoiceStrategy,
   TaskStatisticsRequirements,
-  WorkerChoiceStrategyOptions
+  WorkerChoiceStrategyOptions,
 } from './selection-strategies-types.js'
 
 /**
  * Selects the least busy worker.
- *
  * @typeParam Worker - Type of worker which manages the strategy.
  * @typeParam Data - Type of data sent to the worker. This can only be structured-cloneable data.
  * @typeParam Response - Type of execution response. This can only be structured-cloneable data.
@@ -27,14 +26,14 @@ export class LeastBusyWorkerChoiceStrategy<
     runTime: {
       aggregate: true,
       average: false,
-      median: false
+      median: false,
     },
     waitTime: {
       aggregate: true,
       average: false,
-      median: false
+      median: false,
     },
-    elu: DEFAULT_MEASUREMENT_STATISTICS_REQUIREMENTS
+    elu: DEFAULT_MEASUREMENT_STATISTICS_REQUIREMENTS,
   }
 
   /** @inheritDoc */
index 6eaaacfbd4545d82c52c22eadc160ee286a8011a..ead02e850c8a82b4abf38c7a79b0f2155d19fb0a 100644 (file)
@@ -5,12 +5,11 @@ import { AbstractWorkerChoiceStrategy } from './abstract-worker-choice-strategy.
 import type {
   IWorkerChoiceStrategy,
   TaskStatisticsRequirements,
-  WorkerChoiceStrategyOptions
+  WorkerChoiceStrategyOptions,
 } from './selection-strategies-types.js'
 
 /**
  * Selects the worker with the least ELU.
- *
  * @typeParam Worker - Type of worker which manages the strategy.
  * @typeParam Data - Type of data sent to the worker. This can only be structured-cloneable data.
  * @typeParam Response - Type of execution response. This can only be structured-cloneable data.
@@ -29,8 +28,8 @@ export class LeastEluWorkerChoiceStrategy<
     elu: {
       aggregate: true,
       average: false,
-      median: false
-    }
+      median: false,
+    },
   }
 
   /** @inheritDoc */
index 601b72beba7e2ece8dc70319e682067c43fe70e0..1ee6b7b8aeaf646488c20f7222e0a8fc45a27f7e 100644 (file)
@@ -3,12 +3,11 @@ import type { IWorker } from '../worker.js'
 import { AbstractWorkerChoiceStrategy } from './abstract-worker-choice-strategy.js'
 import type {
   IWorkerChoiceStrategy,
-  WorkerChoiceStrategyOptions
+  WorkerChoiceStrategyOptions,
 } from './selection-strategies-types.js'
 
 /**
  * Selects the least used worker.
- *
  * @typeParam Worker - Type of worker which manages the strategy.
  * @typeParam Data - Type of data sent to the worker. This can only be structured-cloneable data.
  * @typeParam Response - Type of execution response. This can only be structured-cloneable data.
index 83126d97847887d9a079cc6f875077b1494729c9..1f5c499e0103dcddf612fe8e540d92c570d91656 100644 (file)
@@ -3,12 +3,11 @@ import type { IWorker } from '../worker.js'
 import { AbstractWorkerChoiceStrategy } from './abstract-worker-choice-strategy.js'
 import type {
   IWorkerChoiceStrategy,
-  WorkerChoiceStrategyOptions
+  WorkerChoiceStrategyOptions,
 } from './selection-strategies-types.js'
 
 /**
  * Selects the next worker in a round robin fashion.
- *
  * @typeParam Worker - Type of worker which manages the strategy.
  * @typeParam Data - Type of data sent to the worker. This can only be structured-cloneable data.
  * @typeParam Response - Type of execution response. This can only be structured-cloneable data.
index 1a8ea298198d842bd8cd622f74abb6a30f7b28fc..745b140a90873beb9a8bf31d49c48033ea257533 100644 (file)
@@ -36,10 +36,9 @@ export const WorkerChoiceStrategies: Readonly<{
   WEIGHTED_ROUND_ROBIN: 'WEIGHTED_ROUND_ROBIN',
   /**
    * Interleaved weighted round robin worker selection strategy.
-   *
    * @experimental
    */
-  INTERLEAVED_WEIGHTED_ROUND_ROBIN: 'INTERLEAVED_WEIGHTED_ROUND_ROBIN'
+  INTERLEAVED_WEIGHTED_ROUND_ROBIN: 'INTERLEAVED_WEIGHTED_ROUND_ROBIN',
 } as const)
 
 /**
@@ -57,7 +56,7 @@ export const Measurements: Readonly<{
 }> = Object.freeze({
   runTime: 'runTime',
   waitTime: 'waitTime',
-  elu: 'elu'
+  elu: 'elu',
 } as const)
 
 /**
@@ -85,26 +84,22 @@ export interface WorkerChoiceStrategyOptions {
   readonly measurement?: Measurement
   /**
    * Runtime options.
-   *
    * @defaultValue \{ median: false \}
    */
   readonly runTime?: MeasurementOptions
   /**
    * Wait time options.
-   *
    * @defaultValue \{ median: false \}
    */
   readonly waitTime?: MeasurementOptions
   /**
    * Event loop utilization options.
-   *
    * @defaultValue \{ median: false \}
    */
   readonly elu?: MeasurementOptions
   /**
    * Worker weights to use for weighted round robin worker selection strategies.
    * A weight is tasks maximum execution time in milliseconds for a worker node.
-   *
    * @defaultValue Weights computed automatically given the CPU performance.
    */
   weights?: Record<number, number>
@@ -112,7 +107,6 @@ export interface WorkerChoiceStrategyOptions {
 
 /**
  * Measurement statistics requirements.
- *
  * @internal
  */
 export interface MeasurementStatisticsRequirements {
@@ -132,7 +126,6 @@ export interface MeasurementStatisticsRequirements {
 
 /**
  * Pool worker node worker usage statistics requirements.
- *
  * @internal
  */
 export interface TaskStatisticsRequirements {
@@ -152,7 +145,6 @@ export interface TaskStatisticsRequirements {
 
 /**
  * Strategy policy.
- *
  * @internal
  */
 export interface StrategyPolicy {
@@ -168,7 +160,6 @@ export interface StrategyPolicy {
 
 /**
  * Worker choice strategy interface.
- *
  * @internal
  */
 export interface IWorkerChoiceStrategy {
@@ -182,14 +173,12 @@ export interface IWorkerChoiceStrategy {
   readonly taskStatisticsRequirements: TaskStatisticsRequirements
   /**
    * Resets strategy internals.
-   *
    * @returns `true` if the reset is successful, `false` otherwise.
    */
   readonly reset: () => boolean
   /**
    * Updates the worker node key strategy internals.
    * This is called after a task has been executed on a worker node.
-   *
    * @returns `true` if the update is successful, `false` otherwise.
    */
   readonly update: (workerNodeKey: number) => boolean
@@ -197,20 +186,17 @@ export interface IWorkerChoiceStrategy {
    * Chooses a worker node in the pool and returns its key.
    * If no worker nodes are not eligible, `undefined` is returned.
    * If `undefined` is returned, the caller retry.
-   *
    * @returns The worker node key or `undefined`.
    */
   readonly choose: () => number | undefined
   /**
    * Removes the worker node key from strategy internals.
-   *
    * @param workerNodeKey - The worker node key.
    * @returns `true` if the worker node key is removed, `false` otherwise.
    */
   readonly remove: (workerNodeKey: number) => boolean
   /**
    * Sets the worker choice strategy options.
-   *
    * @param opts - The worker choice strategy options.
    */
   readonly setOptions: (opts: WorkerChoiceStrategyOptions | undefined) => void
index 3c7f5f4df327afcce3aaf7ee7f7ee88c397e6513..07517535e57ba7f7fc645973c3bfe406f9900271 100644 (file)
@@ -15,7 +15,7 @@ import {
   type TaskStatisticsRequirements,
   WorkerChoiceStrategies,
   type WorkerChoiceStrategy,
-  type WorkerChoiceStrategyOptions
+  type WorkerChoiceStrategyOptions,
 } from './selection-strategies-types.js'
 import { WeightedRoundRobinWorkerChoiceStrategy } from './weighted-round-robin-worker-choice-strategy.js'
 import type { WorkerChoiceStrategiesContext } from './worker-choice-strategies-context.js'
@@ -33,16 +33,14 @@ const estimatedCpuSpeed = (): number => {
 const getDefaultWorkerWeight = (): number => {
   const currentCpus = cpus()
   let estCpuSpeed: number | undefined
-  // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
+
   if (currentCpus.every(cpu => cpu.speed == null || cpu.speed === 0)) {
     estCpuSpeed = estimatedCpuSpeed()
   }
   let cpusCycleTimeWeight = 0
   for (const cpu of currentCpus) {
-    // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
     if (cpu.speed == null || cpu.speed === 0) {
       cpu.speed =
-        // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
         currentCpus.find(cpu => cpu.speed != null && cpu.speed !== 0)?.speed ??
         estCpuSpeed ??
         2000
@@ -95,9 +93,9 @@ export const buildWorkerChoiceStrategyOptions = <
     ...{
       runTime: { median: false },
       waitTime: { median: false },
-      elu: { median: false }
+      elu: { median: false },
     },
-    ...opts
+    ...opts,
   }
 }
 
@@ -124,7 +122,7 @@ export const buildWorkerChoiceStrategiesPolicy = (
   )
   return {
     dynamicWorkerUsage: policies.some(p => p.dynamicWorkerUsage),
-    dynamicWorkerReady: policies.some(p => p.dynamicWorkerReady)
+    dynamicWorkerReady: policies.some(p => p.dynamicWorkerReady),
   }
 }
 
@@ -140,18 +138,18 @@ export const buildWorkerChoiceStrategiesTaskStatisticsRequirements = (
     runTime: {
       aggregate: taskStatisticsRequirements.some(r => r.runTime.aggregate),
       average: taskStatisticsRequirements.some(r => r.runTime.average),
-      median: taskStatisticsRequirements.some(r => r.runTime.median)
+      median: taskStatisticsRequirements.some(r => r.runTime.median),
     },
     waitTime: {
       aggregate: taskStatisticsRequirements.some(r => r.waitTime.aggregate),
       average: taskStatisticsRequirements.some(r => r.waitTime.average),
-      median: taskStatisticsRequirements.some(r => r.waitTime.median)
+      median: taskStatisticsRequirements.some(r => r.waitTime.median),
     },
     elu: {
       aggregate: taskStatisticsRequirements.some(r => r.elu.aggregate),
       average: taskStatisticsRequirements.some(r => r.elu.average),
-      median: taskStatisticsRequirements.some(r => r.elu.median)
-    }
+      median: taskStatisticsRequirements.some(r => r.elu.median),
+    },
   }
 }
 
@@ -183,7 +181,6 @@ export const getWorkerChoiceStrategy = <Worker extends IWorker, Data, Response>(
       ))(pool, opts)
     default:
       throw new Error(
-        // eslint-disable-next-line @typescript-eslint/restrict-template-expressions
         `Worker choice strategy '${workerChoiceStrategy}' is not valid`
       )
   }
index 6ce55c9a2554c0e951d67b503642f800205b9805..ffd4fc39ca2a99fbb9f74044892e0949653d5c42 100644 (file)
@@ -5,13 +5,12 @@ import { AbstractWorkerChoiceStrategy } from './abstract-worker-choice-strategy.
 import type {
   IWorkerChoiceStrategy,
   TaskStatisticsRequirements,
-  WorkerChoiceStrategyOptions
+  WorkerChoiceStrategyOptions,
 } from './selection-strategies-types.js'
 
 /**
  * Selects the next worker with a weighted round robin scheduling algorithm.
  * Loosely modeled after the weighted round robin queueing algorithm: https://en.wikipedia.org/wiki/Weighted_round_robin.
- *
  * @typeParam Worker - Type of worker which manages the strategy.
  * @typeParam Data - Type of data sent to the worker. This can only be structured-cloneable data.
  * @typeParam Response - Type of execution response. This can only be structured-cloneable data.
@@ -28,14 +27,14 @@ export class WeightedRoundRobinWorkerChoiceStrategy<
     runTime: {
       aggregate: true,
       average: true,
-      median: false
+      median: false,
     },
     waitTime: {
       aggregate: true,
       average: true,
-      median: false
+      median: false,
     },
-    elu: DEFAULT_MEASUREMENT_STATISTICS_REQUIREMENTS
+    elu: DEFAULT_MEASUREMENT_STATISTICS_REQUIREMENTS,
   }
 
   /**
index 185fed71287e668179e201d7ee79848463fd1d76..d030a4524351beea255a1d57edda357435b70013 100644 (file)
@@ -5,19 +5,18 @@ import type {
   StrategyPolicy,
   TaskStatisticsRequirements,
   WorkerChoiceStrategy,
-  WorkerChoiceStrategyOptions
+  WorkerChoiceStrategyOptions,
 } from './selection-strategies-types.js'
 import { WorkerChoiceStrategies } from './selection-strategies-types.js'
 import {
   buildWorkerChoiceStrategiesPolicy,
   buildWorkerChoiceStrategiesTaskStatisticsRequirements,
   getWorkerChoiceStrategiesRetries,
-  getWorkerChoiceStrategy
+  getWorkerChoiceStrategy,
 } from './selection-strategies-utils.js'
 
 /**
  * The worker choice strategies context.
- *
  * @typeParam Worker - Type of worker.
  * @typeParam Data - Type of data sent to the worker. This can only be structured-cloneable data.
  * @typeParam Response - Type of execution response. This can only be structured-cloneable data.
@@ -41,8 +40,8 @@ export class WorkerChoiceStrategiesContext<
    * The worker choice strategies registered in the context.
    */
   private readonly workerChoiceStrategies: Map<
-  WorkerChoiceStrategy,
-  IWorkerChoiceStrategy
+    WorkerChoiceStrategy,
+    IWorkerChoiceStrategy
   >
 
   /**
@@ -62,7 +61,6 @@ export class WorkerChoiceStrategiesContext<
 
   /**
    * Worker choice strategies context constructor.
-   *
    * @param pool - The pool instance.
    * @param workerChoiceStrategies - The worker choice strategies. @defaultValue [WorkerChoiceStrategies.ROUND_ROBIN]
    * @param opts - The worker choice strategy options.
@@ -70,15 +68,15 @@ export class WorkerChoiceStrategiesContext<
   public constructor (
     private readonly pool: IPool<Worker, Data, Response>,
     workerChoiceStrategies: WorkerChoiceStrategy[] = [
-      WorkerChoiceStrategies.ROUND_ROBIN
+      WorkerChoiceStrategies.ROUND_ROBIN,
     ],
     opts?: WorkerChoiceStrategyOptions
   ) {
     this.execute = this.execute.bind(this)
     this.defaultWorkerChoiceStrategy = workerChoiceStrategies[0]
     this.workerChoiceStrategies = new Map<
-    WorkerChoiceStrategy,
-    IWorkerChoiceStrategy
+      WorkerChoiceStrategy,
+      IWorkerChoiceStrategy
     >()
     for (const workerChoiceStrategy of workerChoiceStrategies) {
       this.addWorkerChoiceStrategy(workerChoiceStrategy, this.pool, opts)
@@ -99,7 +97,6 @@ export class WorkerChoiceStrategiesContext<
 
   /**
    * Gets the active worker choice strategies in the context policy.
-   *
    * @returns The strategies policy.
    */
   public getPolicy (): StrategyPolicy {
@@ -108,7 +105,6 @@ export class WorkerChoiceStrategiesContext<
 
   /**
    * Gets the active worker choice strategies in the context task statistics requirements.
-   *
    * @returns The strategies task statistics requirements.
    */
   public getTaskStatisticsRequirements (): TaskStatisticsRequirements {
@@ -117,7 +113,6 @@ export class WorkerChoiceStrategiesContext<
 
   /**
    * Sets the default worker choice strategy to use in the context.
-   *
    * @param workerChoiceStrategy - The default worker choice strategy to set.
    * @param opts - The worker choice strategy options.
    */
@@ -133,7 +128,7 @@ export class WorkerChoiceStrategiesContext<
 
   /**
    * Updates the worker node key in the active worker choice strategies in the context internals.
-   *
+   * @param workerNodeKey
    * @returns `true` if the update is successful, `false` otherwise.
    */
   public update (workerNodeKey: number): boolean {
@@ -145,7 +140,6 @@ export class WorkerChoiceStrategiesContext<
 
   /**
    * Executes the given worker choice strategy in the context algorithm.
-   *
    * @param workerChoiceStrategy - The worker choice strategy algorithm to execute. @defaultValue this.defaultWorkerChoiceStrategy
    * @returns The key of the worker node.
    * @throws {@link https://nodejs.org/api/errors.html#class-error} If after computed retries the worker node key is null or undefined.
@@ -162,7 +156,6 @@ export class WorkerChoiceStrategiesContext<
 
   /**
    * Executes the given worker choice strategy.
-   *
    * @param workerChoiceStrategy - The worker choice strategy.
    * @returns The key of the worker node.
    * @throws {@link https://nodejs.org/api/errors.html#class-error} If after computed retries the worker node key is null or undefined.
@@ -189,7 +182,6 @@ export class WorkerChoiceStrategiesContext<
 
   /**
    * Removes the worker node key from the active worker choice strategies in the context.
-   *
    * @param workerNodeKey - The worker node key.
    * @returns `true` if the removal is successful, `false` otherwise.
    */
@@ -202,7 +194,6 @@ export class WorkerChoiceStrategiesContext<
 
   /**
    * Sets the active worker choice strategies in the context options.
-   *
    * @param opts - The worker choice strategy options.
    */
   public setOptions (opts: WorkerChoiceStrategyOptions | undefined): void {
@@ -213,7 +204,6 @@ export class WorkerChoiceStrategiesContext<
 
   /**
    * Synchronizes the active worker choice strategies in the context with the given worker choice strategies.
-   *
    * @param workerChoiceStrategies - The worker choice strategies to synchronize.
    * @param opts - The worker choice strategy options.
    */
@@ -242,8 +232,8 @@ export class WorkerChoiceStrategiesContext<
 
   /**
    * Adds a worker choice strategy to the context.
-   *
    * @param workerChoiceStrategy - The worker choice strategy to add.
+   * @param pool
    * @param opts - The worker choice strategy options.
    * @returns The worker choice strategies.
    */
@@ -268,7 +258,6 @@ export class WorkerChoiceStrategiesContext<
 
   /**
    * Removes a worker choice strategy from the context.
-   *
    * @param workerChoiceStrategy - The worker choice strategy to remove.
    * @returns `true` if the worker choice strategy is removed, `false` otherwise.
    */
index 8e795512694aa41a2ea82b9c727e3ebd348b01c9..0d088da1489fa04b1c9df45540d4cb44431e5d32 100644 (file)
@@ -7,7 +7,6 @@ import { FixedThreadPool, type ThreadPoolOptions } from './fixed.js'
  *
  * This thread pool creates new threads when the others are busy, up to the maximum number of threads.
  * When the maximum number of threads is reached and workers are busy, an event is emitted. If you want to listen to this event, use the pool's `emitter`.
- *
  * @typeParam Data - Type of data sent to the worker. This can only be structured-cloneable data.
  * @typeParam Response - Type of execution response. This can only be structured-cloneable data.
  * @author [Alessandro Pio Ardizio](https://github.com/pioardi)
@@ -19,7 +18,6 @@ export class DynamicThreadPool<
 > extends FixedThreadPool<Data, Response> {
   /**
    * Constructs a new poolifier dynamic thread pool.
-   *
    * @param min - Minimum number of threads which are always active.
    * @param max - Maximum number of threads that can be created by this pool.
    * @param filePath - Path to an implementation of a `ThreadWorker` file, which can be relative or absolute.
index 7977cd61abd5263023b855fe9f7f23ba5135de10..85c5c9be8f94f4dc1b41ea873d0bbd9e742dac19 100644 (file)
@@ -1,7 +1,7 @@
 import {
   isMainThread,
   type TransferListItem,
-  type Worker
+  type Worker,
 } from 'node:worker_threads'
 
 import type { MessageValue } from '../../utility-types.js'
@@ -16,7 +16,6 @@ export type ThreadPoolOptions = PoolOptions<Worker>
 
 /**
  * A thread pool with a fixed number of threads.
- *
  * @typeParam Data - Type of data sent to the worker. This can only be structured-cloneable data.
  * @typeParam Response - Type of execution response. This can only be structured-cloneable data.
  * @author [Alessandro Pio Ardizio](https://github.com/pioardi)
@@ -28,10 +27,10 @@ export class FixedThreadPool<
 > extends AbstractPool<Worker, Data, Response> {
   /**
    * Constructs a new poolifier fixed thread pool.
-   *
    * @param numberOfThreads - Number of threads for this pool.
    * @param filePath - Path to an implementation of a `ThreadWorker` file, which can be relative or absolute.
    * @param opts - Options for this fixed thread pool.
+   * @param maximumNumberOfThreads
    */
   public constructor (
     numberOfThreads: number,
@@ -56,7 +55,7 @@ export class FixedThreadPool<
     this.workerNodes[workerNodeKey]?.messageChannel?.port1.postMessage(
       {
         ...message,
-        workerId: this.getWorkerInfo(workerNodeKey)?.id
+        workerId: this.getWorkerInfo(workerNodeKey)?.id,
       } satisfies MessageValue<Data>,
       transferList
     )
@@ -71,7 +70,7 @@ export class FixedThreadPool<
       {
         ready: false,
         workerId: this.getWorkerInfo(workerNodeKey)?.id,
-        port: port2
+        port: port2,
       } satisfies MessageValue<Data>,
       [port2]
     )
index d4649d70a56cc31dbb51ddf62aa3b79eca3ef4ef..3ac39b4d478e7dec43b97546066fbb101706b696 100644 (file)
@@ -4,7 +4,7 @@ import { env } from 'node:process'
 import {
   SHARE_ENV,
   Worker as ThreadWorker,
-  type WorkerOptions
+  type WorkerOptions,
 } from 'node:worker_threads'
 
 import type { MessageValue, Task } from '../utility-types.js'
@@ -13,7 +13,7 @@ import type { TasksQueueOptions } from './pool.js'
 import {
   type MeasurementStatisticsRequirements,
   WorkerChoiceStrategies,
-  type WorkerChoiceStrategy
+  type WorkerChoiceStrategy,
 } from './selection-strategies/selection-strategies-types.js'
 import type { WorkerChoiceStrategiesContext } from './selection-strategies/worker-choice-strategies-context.js'
 import {
@@ -23,7 +23,7 @@ import {
   type WorkerNodeOptions,
   type WorkerType,
   WorkerTypes,
-  type WorkerUsage
+  type WorkerUsage,
 } from './worker.js'
 
 /**
@@ -33,7 +33,7 @@ export const DEFAULT_MEASUREMENT_STATISTICS_REQUIREMENTS: MeasurementStatisticsR
   {
     aggregate: false,
     average: false,
-    median: false
+    median: false,
   }
 
 export const getDefaultTasksQueueOptions = (
@@ -44,7 +44,7 @@ export const getDefaultTasksQueueOptions = (
     concurrency: 1,
     taskStealing: true,
     tasksStealingOnBackPressure: false,
-    tasksFinishedTimeout: 2000
+    tasksFinishedTimeout: 2000,
   }
 }
 
@@ -216,7 +216,6 @@ export const checkWorkerNodeArguments = (
 
 /**
  * Updates the given measurement statistics.
- *
  * @param measurementStatistics - The measurement statistics to update.
  * @param measurementRequirements - The measurement statistics requirements.
  * @param measurementValue - The measurement value.
@@ -262,7 +261,6 @@ const updateMeasurementStatistics = (
   }
 }
 if (env.NODE_ENV === 'test') {
-  // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
   exports.updateMeasurementStatistics = updateMeasurementStatistics
 }
 
@@ -292,7 +290,6 @@ export const updateTaskStatisticsWorkerUsage = <Response = unknown>(
 ): void => {
   const workerTaskStatistics = workerUsage.tasks
   if (
-    // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
     workerTaskStatistics.executing != null &&
     workerTaskStatistics.executing > 0
   ) {
@@ -369,25 +366,23 @@ export const updateEluWorkerUsage = <
 export const createWorker = <Worker extends IWorker>(
   type: WorkerType,
   filePath: string,
-  opts: { env?: Record<string, unknown>, workerOptions?: WorkerOptions }
+  opts: { env?: Record<string, unknown>; workerOptions?: WorkerOptions }
 ): Worker => {
   switch (type) {
     case WorkerTypes.thread:
       return new ThreadWorker(filePath, {
         env: SHARE_ENV,
-        ...opts.workerOptions
+        ...opts.workerOptions,
       }) as unknown as Worker
     case WorkerTypes.cluster:
       return cluster.fork(opts.env) as unknown as Worker
     default:
-      // eslint-disable-next-line @typescript-eslint/restrict-template-expressions
       throw new Error(`Unknown worker type '${type}'`)
   }
 }
 
 /**
  * Returns the worker type of the given worker.
- *
  * @param worker - The worker to get the type of.
  * @returns The worker type of the given worker.
  * @internal
@@ -402,7 +397,6 @@ export const getWorkerType = (worker: IWorker): WorkerType | undefined => {
 
 /**
  * Returns the worker id of the given worker.
- *
  * @param worker - The worker to get the id of.
  * @returns The worker id of the given worker.
  * @internal
index f7a48d3ba43e06cadf9a5da8c855a0b5ce1547bb..d29a6e323f35208e22b6f87ca4610fb0af1b3e34 100644 (file)
@@ -9,7 +9,7 @@ import {
   checkWorkerNodeArguments,
   createWorker,
   getWorkerId,
-  getWorkerType
+  getWorkerType,
 } from './utils.js'
 import {
   type EventHandler,
@@ -21,12 +21,11 @@ import {
   type WorkerNodeOptions,
   type WorkerType,
   WorkerTypes,
-  type WorkerUsage
+  type WorkerUsage,
 } from './worker.js'
 
 /**
  * Worker node.
- *
  * @typeParam Worker - Type of worker.
  * @typeParam Data - Type of data sent to the worker. This can only be structured-cloneable data.
  */
@@ -51,7 +50,6 @@ export class WorkerNode<Worker extends IWorker, Data = unknown>
 
   /**
    * Constructs a new worker node.
-   *
    * @param type - The worker type.
    * @param filePath - Path to the worker file.
    * @param opts - The worker node options.
@@ -61,7 +59,7 @@ export class WorkerNode<Worker extends IWorker, Data = unknown>
     checkWorkerNodeArguments(type, filePath, opts)
     this.worker = createWorker<Worker>(type, filePath, {
       env: opts.env,
-      workerOptions: opts.workerOptions
+      workerOptions: opts.workerOptions,
     })
     this.info = this.initWorkerInfo(this.worker)
     this.usage = this.initWorkerUsage()
@@ -222,7 +220,7 @@ export class WorkerNode<Worker extends IWorker, Data = unknown>
       dynamic: false,
       ready: false,
       stealing: false,
-      backPressure: false
+      backPressure: false,
     }
   }
 
@@ -245,22 +243,22 @@ export class WorkerNode<Worker extends IWorker, Data = unknown>
         },
         sequentiallyStolen: 0,
         stolen: 0,
-        failed: 0
+        failed: 0,
       },
       runTime: {
-        history: new CircularBuffer(MeasurementHistorySize)
+        history: new CircularBuffer(MeasurementHistorySize),
       },
       waitTime: {
-        history: new CircularBuffer(MeasurementHistorySize)
+        history: new CircularBuffer(MeasurementHistorySize),
       },
       elu: {
         idle: {
-          history: new CircularBuffer(MeasurementHistorySize)
+          history: new CircularBuffer(MeasurementHistorySize),
         },
         active: {
-          history: new CircularBuffer(MeasurementHistorySize)
-        }
-      }
+          history: new CircularBuffer(MeasurementHistorySize),
+        },
+      },
     }
   }
 
@@ -288,22 +286,22 @@ export class WorkerNode<Worker extends IWorker, Data = unknown>
         },
         sequentiallyStolen: 0,
         stolen: 0,
-        failed: 0
+        failed: 0,
       },
       runTime: {
-        history: new CircularBuffer(MeasurementHistorySize)
+        history: new CircularBuffer(MeasurementHistorySize),
       },
       waitTime: {
-        history: new CircularBuffer(MeasurementHistorySize)
+        history: new CircularBuffer(MeasurementHistorySize),
       },
       elu: {
         idle: {
-          history: new CircularBuffer(MeasurementHistorySize)
+          history: new CircularBuffer(MeasurementHistorySize),
         },
         active: {
-          history: new CircularBuffer(MeasurementHistorySize)
-        }
-      }
+          history: new CircularBuffer(MeasurementHistorySize),
+        },
+      },
     }
   }
 }
index c1af1cf79c99d05e7c803e7d072529301b6d678a..9f5fc0c18dd1d2f214dce86d63d65e88faa11642 100644 (file)
@@ -6,14 +6,12 @@ import type { Task, TaskFunctionProperties } from '../utility-types.js'
 
 /**
  * Callback invoked when the worker has started successfully.
- *
  * @typeParam Worker - Type of worker.
  */
 export type OnlineHandler<Worker extends IWorker> = (this: Worker) => void
 
 /**
  * Callback invoked if the worker has received a message.
- *
  * @typeParam Worker - Type of worker.
  */
 export type MessageHandler<Worker extends IWorker> = (
@@ -23,7 +21,6 @@ export type MessageHandler<Worker extends IWorker> = (
 
 /**
  * Callback invoked if the worker raised an error.
- *
  * @typeParam Worker - Type of worker.
  */
 export type ErrorHandler<Worker extends IWorker> = (
@@ -33,7 +30,6 @@ export type ErrorHandler<Worker extends IWorker> = (
 
 /**
  * Callback invoked when the worker exits successfully.
- *
  * @typeParam Worker - Type of worker.
  */
 export type ExitHandler<Worker extends IWorker> = (
@@ -43,7 +39,6 @@ export type ExitHandler<Worker extends IWorker> = (
 
 /**
  * Worker event handler.
- *
  * @typeParam Worker - Type of worker.
  */
 export type EventHandler<Worker extends IWorker> =
@@ -59,7 +54,6 @@ export const MeasurementHistorySize = 386
 
 /**
  * Measurement statistics.
- *
  * @internal
  */
 export interface MeasurementStatistics {
@@ -91,7 +85,6 @@ export interface MeasurementStatistics {
 
 /**
  * Event loop utilization measurement statistics.
- *
  * @internal
  */
 export interface EventLoopUtilizationMeasurementStatistics {
@@ -102,7 +95,6 @@ export interface EventLoopUtilizationMeasurementStatistics {
 
 /**
  * Task statistics.
- *
  * @internal
  */
 export interface TaskStatistics {
@@ -139,10 +131,10 @@ export interface TaskStatistics {
 /**
  * Enumeration of worker types.
  */
-export const WorkerTypes: Readonly<{ thread: 'thread', cluster: 'cluster' }> =
+export const WorkerTypes: Readonly<{ thread: 'thread'; cluster: 'cluster' }> =
   Object.freeze({
     thread: 'thread',
-    cluster: 'cluster'
+    cluster: 'cluster',
   } as const)
 
 /**
@@ -152,7 +144,6 @@ export type WorkerType = keyof typeof WorkerTypes
 
 /**
  * Worker information.
- *
  * @internal
  */
 export interface WorkerInfo {
@@ -190,7 +181,6 @@ export interface WorkerInfo {
 
 /**
  * Worker usage statistics.
- *
  * @internal
  */
 export interface WorkerUsage {
@@ -214,7 +204,6 @@ export interface WorkerUsage {
 
 /**
  * Worker choice strategy data.
- *
  * @internal
  */
 export interface StrategyData {
@@ -235,14 +224,12 @@ export interface IWorker extends EventEmitter {
   readonly threadId?: number
   /**
    * Registers an event handler.
-   *
    * @param event - The event.
    * @param handler - The event handler.
    */
   readonly on: (event: string, handler: EventHandler<this>) => this
   /**
    * Registers once an event handler.
-   *
    * @param event - The event.
    * @param handler - The event handler.
    */
@@ -270,7 +257,6 @@ export interface IWorker extends EventEmitter {
 
 /**
  * Worker node options.
- *
  * @internal
  */
 export interface WorkerNodeOptions {
@@ -283,7 +269,6 @@ export interface WorkerNodeOptions {
 
 /**
  * Worker node interface.
- *
  * @typeParam Worker - Type of worker.
  * @typeParam Data - Type of data sent to the worker. This can only be structured-cloneable data.
  * @internal
@@ -318,33 +303,28 @@ export interface IWorkerNode<Worker extends IWorker, Data = unknown>
   tasksQueueBackPressureSize: number
   /**
    * Sets tasks queue priority.
-   *
    * @param enablePriority - Whether to enable tasks queue priority.
    */
   readonly setTasksQueuePriority: (enablePriority: boolean) => void
   /**
    * Tasks queue size.
-   *
    * @returns The tasks queue size.
    */
   readonly tasksQueueSize: () => number
   /**
    * Enqueue task.
-   *
    * @param task - The task to queue.
    * @returns The tasks queue size.
    */
   readonly enqueueTask: (task: Task<Data>) => number
   /**
    * Dequeue task.
-   *
    * @param bucket - The prioritized bucket to dequeue from. @defaultValue 0
    * @returns The dequeued task.
    */
   readonly dequeueTask: (bucket?: number) => Task<Data> | undefined
   /**
    * Dequeue last prioritized task.
-   *
    * @returns The dequeued task.
    */
   readonly dequeueLastPrioritizedTask: () => Task<Data> | undefined
@@ -354,7 +334,6 @@ export interface IWorkerNode<Worker extends IWorker, Data = unknown>
   readonly clearTasksQueue: () => void
   /**
    * Whether the worker node has back pressure (i.e. its tasks queue is full).
-   *
    * @returns `true` if the worker node has back pressure, `false` otherwise.
    */
   readonly hasBackPressure: () => boolean
@@ -364,7 +343,6 @@ export interface IWorkerNode<Worker extends IWorker, Data = unknown>
   readonly terminate: () => Promise<void>
   /**
    * Registers a worker event handler.
-   *
    * @param event - The event.
    * @param handler - The event handler.
    */
@@ -374,7 +352,6 @@ export interface IWorkerNode<Worker extends IWorker, Data = unknown>
   ) => void
   /**
    * Registers once a worker event handler.
-   *
    * @param event - The event.
    * @param handler - The event handler.
    */
@@ -384,14 +361,12 @@ export interface IWorkerNode<Worker extends IWorker, Data = unknown>
   ) => void
   /**
    * Gets task function worker usage statistics.
-   *
    * @param name - The task function name.
    * @returns The task function worker usage statistics if the task function worker usage statistics are initialized, `undefined` otherwise.
    */
   readonly getTaskFunctionWorkerUsage: (name: string) => WorkerUsage | undefined
   /**
    * Deletes task function worker usage statistics.
-   *
    * @param name - The task function name.
    * @returns `true` if the task function worker usage statistics were deleted, `false` otherwise.
    */
@@ -400,7 +375,6 @@ export interface IWorkerNode<Worker extends IWorker, Data = unknown>
 
 /**
  * Worker node event detail.
- *
  * @internal
  */
 export interface WorkerNodeEventDetail {
index ee3310c3d8f2cb8cf6e4d6287d0a668eb20f4a9c..c613cd2e9ee393589a80950bda985bb7004f35ff 100644 (file)
@@ -9,7 +9,6 @@ export const defaultBucketSize = 2048
 
 /**
  * Priority queue node.
- *
  * @typeParam T - Type of priority queue node data.
  * @internal
  */
@@ -19,7 +18,6 @@ export interface PriorityQueueNode<T> extends FixedPriorityQueue<T> {
 
 /**
  * Priority queue.
- *
  * @typeParam T - Type of priority queue data.
  * @internal
  */
@@ -32,7 +30,6 @@ export class PriorityQueue<T> {
 
   /**
    * Constructs a priority queue.
-   *
    * @param bucketSize - Prioritized bucket size. @defaultValue defaultBucketSize
    * @param enablePriority - Whether to enable priority. @defaultValue false
    * @returns PriorityQueue.
@@ -94,7 +91,6 @@ export class PriorityQueue<T> {
 
   /**
    * Enqueue data into the priority queue.
-   *
    * @param data - Data to enqueue.
    * @param priority - Priority of the data. Lower values have higher priority.
    * @returns The new size of the priority queue.
@@ -116,7 +112,6 @@ export class PriorityQueue<T> {
 
   /**
    * Dequeue data from the priority queue.
-   *
    * @param bucket - The prioritized bucket to dequeue from.
    * @returns The dequeued data or `undefined` if the priority queue is empty.
    */
@@ -171,7 +166,6 @@ export class PriorityQueue<T> {
 
   /**
    * Returns an iterator for the priority queue.
-   *
    * @returns An iterator for the priority queue.
    * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols
    */
@@ -184,7 +178,7 @@ export class PriorityQueue<T> {
         if (value == null) {
           return {
             value: undefined,
-            done: true
+            done: true,
           }
         }
         ++index
@@ -194,9 +188,9 @@ export class PriorityQueue<T> {
         }
         return {
           value,
-          done: false
+          done: false,
         }
-      }
+      },
     }
   }
 }
index 82f79230accb88160ae612e9d5cc5ba7da57d157..f13cce6a70d9f60ed7417b9d2a45675c5179fb72 100644 (file)
@@ -7,7 +7,6 @@ import type { KillBehavior } from './worker/worker-options.js'
 
 /**
  * Worker error.
- *
  * @typeParam Data - Type of data sent to the worker triggering an error. This can only be structured-cloneable data.
  */
 export interface WorkerError<Data = unknown> {
@@ -27,7 +26,6 @@ export interface WorkerError<Data = unknown> {
 
 /**
  * Task performance.
- *
  * @internal
  */
 export interface TaskPerformance {
@@ -51,7 +49,6 @@ export interface TaskPerformance {
 
 /**
  * Worker task performance statistics computation settings.
- *
  * @internal
  */
 export interface WorkerStatistics {
@@ -85,7 +82,6 @@ export interface TaskFunctionProperties {
 
 /**
  * Message object that is passed as a task between main worker and worker.
- *
  * @typeParam Data - Type of data sent to the worker. This can only be structured-cloneable data.
  * @internal
  */
@@ -100,7 +96,6 @@ export interface Task<Data = unknown> {
   readonly data?: Data
   /**
    * Task priority. Lower values have higher priority.
-   *
    * @defaultValue 0
    */
   readonly priority?: number
@@ -124,7 +119,6 @@ export interface Task<Data = unknown> {
 
 /**
  * Message object that is passed between main worker and worker.
- *
  * @typeParam Data - Type of data sent to the worker or execution response. This can only be structured-cloneable data.
  * @typeParam ErrorData - Type of data sent to the worker triggering an error. This can only be structured-cloneable data.
  * @internal
@@ -190,7 +184,6 @@ export interface MessageValue<Data = unknown, ErrorData = unknown>
 
 /**
  * An object holding the task execution response promise resolve/reject callbacks.
- *
  * @typeParam Response - Type of execution response. This can only be structured-cloneable data.
  * @internal
  */
index f38221692c8e76b06a57605f8a9129e198796cec..af6a432b1c2550f9591ecc4714d17af0a012b98a 100644 (file)
@@ -20,7 +20,6 @@ export const EMPTY_FUNCTION: () => void = Object.freeze(() => {
 /**
  * Returns safe host OS optimized estimate of the default amount of parallelism a pool should use.
  * Always returns a value greater than zero.
- *
  * @returns The host OS optimized maximum pool size.
  */
 export const availableParallelism = (): number => {
@@ -38,7 +37,6 @@ export const availableParallelism = (): number => {
 
 /**
  * Sleeps for the given amount of milliseconds.
- *
  * @param ms - The amount of milliseconds to sleep.
  * @returns A promise that resolves after the given amount of milliseconds.
  * @internal
@@ -51,7 +49,6 @@ export const sleep = async (ms: number): Promise<void> => {
 
 /**
  * Computes the retry delay in milliseconds using an exponential back off algorithm.
- *
  * @param retryNumber - The number of retries that have already been attempted
  * @param delayFactor - The base delay factor in milliseconds
  * @returns Delay in milliseconds
@@ -68,7 +65,6 @@ export const exponentialDelay = (
 
 /**
  * Computes the average of the given data set.
- *
  * @param dataSet - Data set.
  * @returns The average of the given data set.
  * @internal
@@ -87,7 +83,6 @@ export const average = (dataSet: number[]): number => {
 
 /**
  * Computes the median of the given data set.
- *
  * @param dataSet - Data set.
  * @returns The median of the given data set.
  * @internal
@@ -109,7 +104,6 @@ export const median = (dataSet: number[]): number => {
 /**
  * Rounds the given number to the given scale.
  * The rounding is done using the "round half away from zero" method.
- *
  * @param num - The number to round.
  * @param scale - The scale to round to.
  * @returns The rounded number.
@@ -122,7 +116,6 @@ export const round = (num: number, scale = 2): number => {
 
 /**
  * Is the given value a plain object?
- *
  * @param value - The value to check.
  * @returns `true` if the given value is a plain object, `false` otherwise.
  * @internal
@@ -135,7 +128,6 @@ export const isPlainObject = (value: unknown): value is object =>
 
 /**
  * Detects whether the given value is a kill behavior or not.
- *
  * @typeParam KB - Which specific KillBehavior type to test against.
  * @param killBehavior - Which kind of kill behavior to detect.
  * @param value - Unknown value.
@@ -151,7 +143,6 @@ export const isKillBehavior = <KB extends KillBehavior>(
 
 /**
  * Detects whether the given value is an asynchronous function or not.
- *
  * @param fn - Unknown value.
  * @returns `true` if `fn` was an asynchronous function, otherwise `false`.
  * @internal
@@ -164,7 +155,6 @@ export const isAsyncFunction = (
 
 /**
  * Generates a cryptographically secure random number in the [0,1[ range
- *
  * @returns A number in the [0,1[ range
  * @internal
  */
@@ -175,7 +165,6 @@ export const secureRandom = (): number => {
 /**
  * Returns the minimum of the given numbers.
  * If no numbers are given, `Number.POSITIVE_INFINITY` is returned.
- *
  * @param args - The numbers to get the minimum of.
  * @returns The minimum of the given numbers.
  * @internal
@@ -189,7 +178,6 @@ export const min = (...args: number[]): number =>
 /**
  * Returns the maximum of the given numbers.
  * If no numbers are given, `Number.NEGATIVE_INFINITY` is returned.
- *
  * @param args - The numbers to get the maximum of.
  * @returns The maximum of the given numbers.
  * @internal
@@ -202,11 +190,9 @@ export const max = (...args: number[]): number =>
 
 /**
  * Wraps a function so that it can only be called once.
- *
  * @param fn - The function to wrap.
  * @param context - The context to bind the function to.
  * @returns The wrapped function.
- *
  * @typeParam A - The function's arguments.
  * @typeParam R - The function's return value.
  * @typeParam C - The function's context.
@@ -219,7 +205,6 @@ export const once = <A extends any[], R, C extends ThisType<any>>(
 ): ((...args: A) => R) => {
   let result: R
   return (...args: A) => {
-    // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
     if (fn != null) {
       result = fn.apply<C, A, R>(context, args)
       ;(fn as unknown as undefined) = (context as unknown as undefined) =
@@ -236,10 +221,10 @@ export const buildTaskFunctionProperties = <Data, Response>(
   return {
     name,
     ...(taskFunctionObject?.priority != null && {
-      priority: taskFunctionObject.priority
+      priority: taskFunctionObject.priority,
     }),
     ...(taskFunctionObject?.strategy != null && {
-      strategy: taskFunctionObject.strategy
-    })
+      strategy: taskFunctionObject.strategy,
+    }),
   }
 }
index bb6ac5666e0252195b4f1cafbda38471ec7fcf07..9b9ded5e9d1cc1267846fb9e0279d88de405262f 100644 (file)
@@ -7,14 +7,14 @@ import type {
   Task,
   TaskFunctionProperties,
   TaskPerformance,
-  WorkerStatistics
+  WorkerStatistics,
 } from '../utility-types.js'
 import {
   buildTaskFunctionProperties,
   DEFAULT_TASK_NAME,
   EMPTY_FUNCTION,
   isAsyncFunction,
-  isPlainObject
+  isPlainObject,
 } from '../utils.js'
 import type {
   TaskAsyncFunction,
@@ -22,12 +22,12 @@ import type {
   TaskFunctionObject,
   TaskFunctionOperationResult,
   TaskFunctions,
-  TaskSyncFunction
+  TaskSyncFunction,
 } from './task-functions.js'
 import {
   checkTaskFunctionName,
   checkValidTaskFunctionObjectEntry,
-  checkValidWorkerOptions
+  checkValidWorkerOptions,
 } from './utils.js'
 import { KillBehaviors, type WorkerOptions } from './worker-options.js'
 
@@ -45,12 +45,11 @@ const DEFAULT_WORKER_OPTIONS: WorkerOptions = {
   /**
    * The function to call when the worker is killed.
    */
-  killHandler: EMPTY_FUNCTION
+  killHandler: EMPTY_FUNCTION,
 }
 
 /**
  * Base class that implements some shared logic for all poolifier workers.
- *
  * @typeParam MainWorker - Type of main worker.
  * @typeParam Data - Type of data this worker receives from pool's execution. This can only be structured-cloneable data.
  * @typeParam Response - Type of response the worker sends back to the main worker. This can only be structured-cloneable data.
@@ -79,11 +78,11 @@ export abstract class AbstractWorker<
   /**
    * Handler id of the `activeInterval` worker activity check.
    */
+  // eslint-disable-next-line no-undef
   protected activeInterval?: NodeJS.Timeout
 
   /**
    * Constructs a new poolifier worker.
-   *
    * @param isMain - Whether this is the main worker or not.
    * @param mainWorker - Reference to main worker.
    * @param taskFunctions - Task function(s) processed by the worker when the pool's `execution` function is invoked. The first function is the default function.
@@ -113,14 +112,13 @@ export abstract class AbstractWorker<
 
   /**
    * Checks if the `taskFunctions` parameter is passed to the constructor and valid.
-   *
    * @param taskFunctions - The task function(s) parameter that should be checked.
    */
   private checkTaskFunctions (
     taskFunctions:
-    | TaskFunction<Data, Response>
-    | TaskFunctions<Data, Response>
-    | undefined
+      | TaskFunction<Data, Response>
+      | TaskFunctions<Data, Response>
+      | undefined
   ): void {
     if (taskFunctions == null) {
       throw new Error('taskFunctions parameter is mandatory')
@@ -141,8 +139,8 @@ export abstract class AbstractWorker<
       for (let [name, fnObj] of Object.entries(taskFunctions)) {
         if (typeof fnObj === 'function') {
           fnObj = { taskFunction: fnObj } satisfies TaskFunctionObject<
-          Data,
-          Response
+            Data,
+            Response
           >
         }
         checkValidTaskFunctionObjectEntry<Data, Response>(name, fnObj)
@@ -165,7 +163,6 @@ export abstract class AbstractWorker<
 
   /**
    * Checks if the worker has a task function with the given name.
-   *
    * @param name - The name of the task function to check.
    * @returns Whether the worker has a task function with the given name or not.
    */
@@ -181,7 +178,6 @@ export abstract class AbstractWorker<
   /**
    * Adds a task function to the worker.
    * If a task function with the same name already exists, it is replaced.
-   *
    * @param name - The name of the task function to add.
    * @param fn - The task function to add.
    * @returns Whether the task function was added or not.
@@ -218,7 +214,6 @@ export abstract class AbstractWorker<
 
   /**
    * Removes a task function from the worker.
-   *
    * @param name - The name of the task function to remove.
    * @returns Whether the task function existed and was removed or not.
    */
@@ -248,7 +243,6 @@ export abstract class AbstractWorker<
 
   /**
    * Lists the properties of the worker's task functions.
-   *
    * @returns The properties of the worker's task functions.
    */
   public listTaskFunctionsProperties (): TaskFunctionProperties[] {
@@ -278,13 +272,12 @@ export abstract class AbstractWorker<
         defaultTaskFunctionName,
         this.taskFunctions.get(defaultTaskFunctionName)
       ),
-      ...taskFunctionsProperties
+      ...taskFunctionsProperties,
     ]
   }
 
   /**
    * Sets the default task function to use in the worker.
-   *
    * @param name - The name of the task function to use as default task function.
    * @returns Whether the default task function was set or not.
    */
@@ -312,14 +305,12 @@ export abstract class AbstractWorker<
 
   /**
    * Handles the ready message sent by the main worker.
-   *
    * @param message - The ready message.
    */
   protected abstract handleReadyMessage (message: MessageValue<Data>): void
 
   /**
    * Worker message listener.
-   *
    * @param message - The received message.
    */
   protected messageListener (message: MessageValue<Data>): void {
@@ -330,7 +321,7 @@ export abstract class AbstractWorker<
       taskFunctionOperation,
       taskId,
       data,
-      kill
+      kill,
     } = message
     if (statistics != null) {
       // Statistics message received
@@ -364,16 +355,16 @@ export abstract class AbstractWorker<
     switch (taskFunctionOperation) {
       case 'add':
         response = this.addTaskFunction(taskFunctionProperties.name, {
-          // eslint-disable-next-line @typescript-eslint/no-implied-eval, no-new-func
+          // eslint-disable-next-line no-new-func
           taskFunction: new Function(
             `return ${taskFunction}`
           )() as TaskFunction<Data, Response>,
           ...(taskFunctionProperties.priority != null && {
-            priority: taskFunctionProperties.priority
+            priority: taskFunctionProperties.priority,
           }),
           ...(taskFunctionProperties.strategy != null && {
-            strategy: taskFunctionProperties.strategy
-          })
+            strategy: taskFunctionProperties.strategy,
+          }),
         })
         break
       case 'remove':
@@ -394,21 +385,20 @@ export abstract class AbstractWorker<
         response.error != null && {
         workerError: {
           name: taskFunctionProperties.name,
-          message: this.handleError(response.error as Error | string)
-        }
-      })
+          message: this.handleError(response.error as Error | string),
+        },
+      }),
     })
   }
 
   /**
    * Handles a kill message sent by the main worker.
-   *
    * @param message - The kill message.
    */
-  protected handleKillMessage (_message: MessageValue<Data>): void {
+  protected handleKillMessage (message: MessageValue<Data>): void {
     this.stopCheckActive()
     if (isAsyncFunction(this.opts.killHandler)) {
-      (this.opts.killHandler() as Promise<void>)
+      ;(this.opts.killHandler() as Promise<void>)
         .then(() => {
           this.sendToMainWorker({ kill: 'success' })
           return undefined
@@ -418,8 +408,7 @@ export abstract class AbstractWorker<
         })
     } else {
       try {
-        // eslint-disable-next-line @typescript-eslint/no-invalid-void-type
-        this.opts.killHandler?.() as void
+        this.opts.killHandler?.()
         this.sendToMainWorker({ kill: 'success' })
       } catch {
         this.sendToMainWorker({ kill: 'failure' })
@@ -429,7 +418,6 @@ export abstract class AbstractWorker<
 
   /**
    * Check if the message worker id is set and matches the worker id.
-   *
    * @param message - The message to check.
    * @throws {@link https://nodejs.org/api/errors.html#class-error} If the message worker id is not set or does not match the worker id.
    */
@@ -478,7 +466,6 @@ export abstract class AbstractWorker<
 
   /**
    * Returns the main worker.
-   *
    * @returns Reference to the main worker.
    * @throws {@link https://nodejs.org/api/errors.html#class-error} If the main worker is not set.
    */
@@ -491,7 +478,6 @@ export abstract class AbstractWorker<
 
   /**
    * Sends a message to main worker.
-   *
    * @param message - The response message.
    */
   protected abstract sendToMainWorker (
@@ -503,13 +489,12 @@ export abstract class AbstractWorker<
    */
   protected sendTaskFunctionsPropertiesToMainWorker (): void {
     this.sendToMainWorker({
-      taskFunctionsProperties: this.listTaskFunctionsProperties()
+      taskFunctionsProperties: this.listTaskFunctionsProperties(),
     })
   }
 
   /**
    * Handles an error and convert it to a string so it can be sent back to the main worker.
-   *
    * @param error - The error raised by the worker.
    * @returns The error message.
    */
@@ -519,7 +504,6 @@ export abstract class AbstractWorker<
 
   /**
    * Runs the given task.
-   *
    * @param task - The task to execute.
    */
   protected readonly run = (task: Task<Data>): void => {
@@ -531,9 +515,9 @@ export abstract class AbstractWorker<
           // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
           name: name!,
           message: `Task function '${name}' not found`,
-          data
+          data,
         },
-        taskId
+        taskId,
       })
       return
     }
@@ -547,7 +531,6 @@ export abstract class AbstractWorker<
 
   /**
    * Runs the given task function synchronously.
-   *
    * @param fn - Task function that will be executed.
    * @param task - Input data for the task function.
    */
@@ -563,7 +546,7 @@ export abstract class AbstractWorker<
       this.sendToMainWorker({
         data: res,
         taskPerformance,
-        taskId
+        taskId,
       })
     } catch (error) {
       this.sendToMainWorker({
@@ -571,9 +554,9 @@ export abstract class AbstractWorker<
           // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
           name: name!,
           message: this.handleError(error as Error | string),
-          data
+          data,
         },
-        taskId
+        taskId,
       })
     } finally {
       this.updateLastTaskTimestamp()
@@ -582,7 +565,6 @@ export abstract class AbstractWorker<
 
   /**
    * Runs the given task function asynchronously.
-   *
    * @param fn - Task function that will be executed.
    * @param task - Input data for the task function.
    */
@@ -598,7 +580,7 @@ export abstract class AbstractWorker<
         this.sendToMainWorker({
           data: res,
           taskPerformance,
-          taskId
+          taskId,
         })
         return undefined
       })
@@ -608,9 +590,9 @@ export abstract class AbstractWorker<
             // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
             name: name!,
             message: this.handleError(error as Error | string),
-            data
+            data,
           },
-          taskId
+          taskId,
         })
       })
       .finally(() => {
@@ -627,8 +609,8 @@ export abstract class AbstractWorker<
       name: name ?? DEFAULT_TASK_NAME,
       timestamp: performance.now(),
       ...(this.statistics.elu && {
-        elu: performance.eventLoopUtilization()
-      })
+        elu: performance.eventLoopUtilization(),
+      }),
     }
   }
 
@@ -641,11 +623,11 @@ export abstract class AbstractWorker<
     return {
       ...taskPerformance,
       ...(this.statistics.runTime && {
-        runTime: performance.now() - taskPerformance.timestamp
+        runTime: performance.now() - taskPerformance.timestamp,
       }),
       ...(this.statistics.elu && {
-        elu: performance.eventLoopUtilization(taskPerformance.elu)
-      })
+        elu: performance.eventLoopUtilization(taskPerformance.elu),
+      }),
     }
   }
 
index 847f2174d1657b05824d12461b8bba054287ae54..d9f6e64756fa94d234023fcd200d3681cd621783 100644 (file)
@@ -13,7 +13,6 @@ import type { WorkerOptions } from './worker-options.js'
  *
  * If you use a `DynamicClusterPool` the extra workers that were created will be terminated,
  * but the minimum number of workers will be guaranteed.
- *
  * @typeParam Data - Type of data this worker receives from pool's execution. This can only be structured-cloneable data.
  * @typeParam Response - Type of response the worker sends back to the main worker. This can only be structured-cloneable data.
  * @author [Christopher Quadflieg](https://github.com/Shinigami92)
@@ -25,7 +24,6 @@ export class ClusterWorker<
 > extends AbstractWorker<Worker, Data, Response> {
   /**
    * Constructs a new poolifier cluster worker.
-   *
    * @param taskFunctions - Task function(s) processed by the worker when the pool's `execution` function is invoked.
    * @param opts - Options for the worker.
    */
@@ -43,12 +41,12 @@ export class ClusterWorker<
         this.getMainWorker().on('message', this.messageListener.bind(this))
         this.sendToMainWorker({
           ready: true,
-          taskFunctionsProperties: this.listTaskFunctionsProperties()
+          taskFunctionsProperties: this.listTaskFunctionsProperties(),
         })
       } catch {
         this.sendToMainWorker({
           ready: false,
-          taskFunctionsProperties: this.listTaskFunctionsProperties()
+          taskFunctionsProperties: this.listTaskFunctionsProperties(),
         })
       }
     }
@@ -65,7 +63,7 @@ export class ClusterWorker<
   ): void => {
     this.getMainWorker().send({
       ...message,
-      workerId: this.id
+      workerId: this.id,
     } satisfies MessageValue<Response>)
   }
 }
index 0b3083c3aed6ca892af39070734c1562648f69af..2fd951fb2ac03d71b820a1673561630f0c9d7736 100644 (file)
@@ -2,10 +2,8 @@ import type { WorkerChoiceStrategy } from '../pools/selection-strategies/selecti
 
 /**
  * Task synchronous function that can be executed.
- *
  * @param data - Data sent to the worker.
  * @returns Execution response.
- *
  * @typeParam Data - Type of data sent to the worker. This can only be structured-cloneable data.
  * @typeParam Response - Type of execution response. This can only be structured-cloneable data.
  */
@@ -16,10 +14,8 @@ export type TaskSyncFunction<Data = unknown, Response = unknown> = (
 /**
  * Task asynchronous function that can be executed.
  * This function must return a promise.
- *
  * @param data - Data sent to the worker.
  * @returns Execution response promise.
- *
  * @typeParam Data - Type of data sent to the worker. This can only be structured-cloneable data.
  * @typeParam Response - Type of execution response. This can only be structured-cloneable data.
  */
@@ -30,7 +26,6 @@ export type TaskAsyncFunction<Data = unknown, Response = unknown> = (
 /**
  * Task function that can be executed.
  * This function can be synchronous or asynchronous.
- *
  * @typeParam Data - Type of data sent to the worker. This can only be structured-cloneable data.
  * @typeParam Response - Type of execution response. This can only be structured-cloneable data.
  */
@@ -40,7 +35,6 @@ export type TaskFunction<Data = unknown, Response = unknown> =
 
 /**
  * Task function object.
- *
  * @typeParam Data - Type of data sent to the worker. This can only be structured-cloneable data.
  * @typeParam Response - Type of execution response. This can only be structured-cloneable data.
  */
@@ -63,13 +57,12 @@ export interface TaskFunctionObject<Data = unknown, Response = unknown> {
  * Tasks functions that can be executed.
  * The key is the name of the task function or task function object.
  * The value is the task function or task function object.
- *
  * @typeParam Data - Type of data sent to the worker. This can only be structured-cloneable data.
  * @typeParam Response - Type of execution response. This can only be structured-cloneable data.
  */
 export type TaskFunctions<Data = unknown, Response = unknown> = Record<
-string,
-TaskFunction<Data, Response> | TaskFunctionObject<Data, Response>
+  string,
+  TaskFunction<Data, Response> | TaskFunctionObject<Data, Response>
 >
 
 /**
index bf8647c53b68f972c1dbe2cf806689d7889d2d2f..8057d6f343caddda5091954cd1ed80e96f2e4b79 100644 (file)
@@ -2,7 +2,7 @@ import {
   isMainThread,
   type MessagePort,
   parentPort,
-  threadId
+  threadId,
 } from 'node:worker_threads'
 
 import type { MessageValue } from '../utility-types.js'
@@ -18,7 +18,6 @@ import type { WorkerOptions } from './worker-options.js'
  *
  * If you use a `DynamicThreadPool` the extra workers that were created will be terminated,
  * but the minimum number of workers will be guaranteed.
- *
  * @typeParam Data - Type of data this worker receives from pool's execution. This can only be structured-cloneable data.
  * @typeParam Response - Type of response the worker sends back to the main thread. This can only be structured-cloneable data.
  * @author [Alessandro Pio Ardizio](https://github.com/pioardi)
@@ -35,7 +34,6 @@ export class ThreadWorker<
 
   /**
    * Constructs a new poolifier thread worker.
-   *
    * @param taskFunctions - Task function(s) processed by the worker when the pool's `execution` function is invoked.
    * @param opts - Options for the worker.
    */
@@ -58,12 +56,12 @@ export class ThreadWorker<
         this.port.on('message', this.messageListener.bind(this))
         this.sendToMainWorker({
           ready: true,
-          taskFunctionsProperties: this.listTaskFunctionsProperties()
+          taskFunctionsProperties: this.listTaskFunctionsProperties(),
         })
       } catch {
         this.sendToMainWorker({
           ready: false,
-          taskFunctionsProperties: this.listTaskFunctionsProperties()
+          taskFunctionsProperties: this.listTaskFunctionsProperties(),
         })
       }
     }
@@ -87,13 +85,12 @@ export class ThreadWorker<
   ): void => {
     this.port?.postMessage({
       ...message,
-      workerId: this.id
+      workerId: this.id,
     } satisfies MessageValue<Response>)
   }
 
   /**
    * @inheritDoc
-   * @override
    */
   protected handleError (error: Error | string): string {
     return error as string
index d0883893581b0a14c24cb415bef585541b71c446..f324a23524646b2553f2c75d6dc62c5a5be16a4c 100644 (file)
@@ -1,6 +1,6 @@
 import {
   checkValidPriority,
-  checkValidWorkerChoiceStrategy
+  checkValidWorkerChoiceStrategy,
 } from '../pools/utils.js'
 import { isPlainObject } from '../utils.js'
 import type { TaskFunctionObject } from './task-functions.js'
@@ -53,7 +53,6 @@ export const checkValidTaskFunctionObjectEntry = <
   }
   if (typeof fnObj.taskFunction !== 'function') {
     throw new TypeError(
-      // eslint-disable-next-line @typescript-eslint/restrict-template-expressions
       `taskFunction object 'taskFunction' property '${fnObj.taskFunction}' is not a function`
     )
   }
index 50cf85bb03910a03fdd25f9e479e2b03dea45270..92761840efda547c43a0c9758231c0c1d1b84bab 100644 (file)
@@ -1,7 +1,7 @@
 /**
  * Enumeration of kill behaviors.
  */
-export const KillBehaviors: Readonly<{ SOFT: 'SOFT', HARD: 'HARD' }> =
+export const KillBehaviors: Readonly<{ SOFT: 'SOFT'; HARD: 'HARD' }> =
   Object.freeze({
     /**
      * If `currentTime - lastActiveTime` is greater than `maxInactiveTime` but the worker is stealing tasks or a task is executing or queued, then the worker **wont** be deleted.
@@ -10,7 +10,7 @@ export const KillBehaviors: Readonly<{ SOFT: 'SOFT', HARD: 'HARD' }> =
     /**
      * If `currentTime - lastActiveTime` is greater than `maxInactiveTime` but the worker is stealing tasks or a task is executing or queued, then the worker will be deleted.
      */
-    HARD: 'HARD'
+    HARD: 'HARD',
   } as const)
 
 /**
@@ -34,7 +34,6 @@ export interface WorkerOptions {
    * - HARD: If `currentTime - lastActiveTime` is greater than `maxInactiveTime` but the worker is stealing tasks or a task is executing or queued, then the worker will be deleted.
    *
    * This option only apply to the newly created workers.
-   *
    * @defaultValue KillBehaviors.SOFT
    */
   killBehavior?: KillBehavior
@@ -45,15 +44,13 @@ export interface WorkerOptions {
    * The last active time of your worker will be updated when it terminates a task.
    *
    * - If `killBehavior` is set to `KillBehaviors.HARD` this value represents also the timeout for the tasks that you submit to the pool,
-   *   when this timeout expires your tasks is interrupted before completion and removed. The worker is killed if is not part of the minimum size of the pool.
+   * when this timeout expires your tasks is interrupted before completion and removed. The worker is killed if is not part of the minimum size of the pool.
    * - If `killBehavior` is set to `KillBehaviors.SOFT` your tasks have no timeout and your workers will not be terminated until your task is completed.
-   *
    * @defaultValue 60000
    */
   maxInactiveTime?: number
   /**
    * The function to call when a worker is killed.
-   *
    * @defaultValue `() => {}`
    */
   killHandler?: KillHandler
index f6afdda9cd63999aacc817ec1878d7dd3b7dde94..751ece907c7db07753aec60e1df91269ea1f1845 100644 (file)
@@ -2,7 +2,7 @@ import { expect } from 'expect'
 
 import { CircularBuffer, defaultBufferSize } from '../lib/circular-buffer.cjs'
 
-describe('Circular buffer test suite', t => {
+describe('Circular buffer test suite', () => {
   it('Verify that circular buffer can be instantiated', () => {
     const circularBuffer = new CircularBuffer()
     expect(circularBuffer).toBeInstanceOf(CircularBuffer)
index 99dcb00120a60c4b09a3a9be595919f902686a13..40b5564313b6dadedbe0d7cc1520ae0b6454ad02 100644 (file)
@@ -2,7 +2,7 @@ import { expect } from 'expect'
 
 import {
   defaultQueueSize,
-  FixedPriorityQueue
+  FixedPriorityQueue,
 } from '../lib/fixed-priority-queue.cjs'
 
 describe('Fixed priority queue test suite', () => {
@@ -35,7 +35,7 @@ describe('Fixed priority queue test suite', () => {
     expect(fixedPriorityQueue.size).toBe(1)
     expect(rtSize).toBe(fixedPriorityQueue.size)
     expect(fixedPriorityQueue.nodeArray).toMatchObject([
-      { data: 1, priority: 0 }
+      { data: 1, priority: 0 },
     ])
     expect(fixedPriorityQueue.capacity).toBe(queueSize)
     rtSize = fixedPriorityQueue.enqueue(2)
@@ -44,7 +44,7 @@ describe('Fixed priority queue test suite', () => {
     expect(rtSize).toBe(fixedPriorityQueue.size)
     expect(fixedPriorityQueue.nodeArray).toMatchObject([
       { data: 1, priority: 0 },
-      { data: 2, priority: 0 }
+      { data: 2, priority: 0 },
     ])
     expect(fixedPriorityQueue.capacity).toBe(queueSize)
     rtSize = fixedPriorityQueue.enqueue(3)
@@ -54,7 +54,7 @@ describe('Fixed priority queue test suite', () => {
     expect(fixedPriorityQueue.nodeArray).toMatchObject([
       { data: 1, priority: 0 },
       { data: 2, priority: 0 },
-      { data: 3, priority: 0 }
+      { data: 3, priority: 0 },
     ])
     expect(fixedPriorityQueue.capacity).toBe(queueSize)
     rtSize = fixedPriorityQueue.enqueue(3, -1)
@@ -65,7 +65,7 @@ describe('Fixed priority queue test suite', () => {
       { data: 3, priority: -1 },
       { data: 1, priority: 0 },
       { data: 2, priority: 0 },
-      { data: 3, priority: 0 }
+      { data: 3, priority: 0 },
     ])
     expect(fixedPriorityQueue.capacity).toBe(queueSize)
     rtSize = fixedPriorityQueue.enqueue(1, 1)
@@ -77,7 +77,7 @@ describe('Fixed priority queue test suite', () => {
       { data: 1, priority: 0 },
       { data: 2, priority: 0 },
       { data: 3, priority: 0 },
-      { data: 1, priority: 1 }
+      { data: 1, priority: 1 },
     ])
     expect(fixedPriorityQueue.capacity).toBe(queueSize)
     expect(() => fixedPriorityQueue.enqueue(4)).toThrow(
@@ -112,7 +112,7 @@ describe('Fixed priority queue test suite', () => {
     expect(fixedPriorityQueue.nodeArray).toMatchObject([
       { data: 2, priority: -1 },
       { data: 1, priority: 0 },
-      { data: 3, priority: 0 }
+      { data: 3, priority: 0 },
     ])
     expect(fixedPriorityQueue.capacity).toBe(queueSize)
     rtItem = fixedPriorityQueue.dequeue()
@@ -122,7 +122,7 @@ describe('Fixed priority queue test suite', () => {
     expect(fixedPriorityQueue.nodeArray).toMatchObject([
       { data: 2, priority: -1 },
       { data: 1, priority: 0 },
-      { data: 3, priority: 0 }
+      { data: 3, priority: 0 },
     ])
     expect(fixedPriorityQueue.capacity).toBe(queueSize)
     rtItem = fixedPriorityQueue.dequeue()
@@ -132,7 +132,7 @@ describe('Fixed priority queue test suite', () => {
     expect(fixedPriorityQueue.nodeArray).toMatchObject([
       { data: 2, priority: -1 },
       { data: 1, priority: 0 },
-      { data: 3, priority: 0 }
+      { data: 3, priority: 0 },
     ])
     expect(fixedPriorityQueue.capacity).toBe(queueSize)
     rtItem = fixedPriorityQueue.dequeue()
@@ -142,7 +142,7 @@ describe('Fixed priority queue test suite', () => {
     expect(fixedPriorityQueue.nodeArray).toMatchObject([
       { data: 2, priority: -1 },
       { data: 1, priority: 0 },
-      { data: 3, priority: 0 }
+      { data: 3, priority: 0 },
     ])
     expect(fixedPriorityQueue.capacity).toBe(queueSize)
   })
@@ -191,14 +191,14 @@ describe('Fixed priority queue test suite', () => {
     fixedPriorityQueue.size = 2
     fixedPriorityQueue.nodeArray = [
       { data: 2, priority: 0 },
-      { data: 3, priority: 0 }
+      { data: 3, priority: 0 },
     ]
     fixedPriorityQueue.clear()
     expect(fixedPriorityQueue.start).toBe(0)
     expect(fixedPriorityQueue.size).toBe(0)
     expect(fixedPriorityQueue.nodeArray).toMatchObject([
       { data: 2, priority: 0 },
-      { data: 3, priority: 0 }
+      { data: 3, priority: 0 },
     ])
   })
 })
index ec8fe516ffbd278d162306920d182be9e76c8427..ec481d2ca918c33f42da25c17c9acc22806594ac 100644 (file)
@@ -17,7 +17,7 @@ import {
   PoolEvents,
   PoolTypes,
   WorkerChoiceStrategies,
-  WorkerTypes
+  WorkerTypes,
 } from '../../lib/index.cjs'
 import { WorkerNode } from '../../lib/pools/worker-node.cjs'
 import { defaultBucketSize, PriorityQueue } from '../../lib/priority-queue.cjs'
@@ -58,7 +58,7 @@ describe('Abstract pool test suite', () => {
           numberOfWorkers,
           './tests/worker-files/thread/testWorker.mjs',
           {
-            errorHandler: e => console.error(e)
+            errorHandler: e => console.error(e),
           }
         )
     ).toThrow(
@@ -230,7 +230,7 @@ describe('Abstract pool test suite', () => {
       enableEvents: true,
       restartWorkerOnError: true,
       enableTasksQueue: false,
-      workerChoiceStrategy: WorkerChoiceStrategies.ROUND_ROBIN
+      workerChoiceStrategy: WorkerChoiceStrategies.ROUND_ROBIN,
     })
     for (const [, workerChoiceStrategy] of pool.workerChoiceStrategiesContext
       .workerChoiceStrategies) {
@@ -240,8 +240,8 @@ describe('Abstract pool test suite', () => {
         elu: { median: false },
         weights: expect.objectContaining({
           0: expect.any(Number),
-          [pool.info.maxSize - 1]: expect.any(Number)
-        })
+          [pool.info.maxSize - 1]: expect.any(Number),
+        }),
       })
     }
     await pool.destroy()
@@ -253,7 +253,7 @@ describe('Abstract pool test suite', () => {
         workerChoiceStrategy: WorkerChoiceStrategies.LEAST_USED,
         workerChoiceStrategyOptions: {
           runTime: { median: true },
-          weights: { 0: 300, 1: 200 }
+          weights: { 0: 300, 1: 200 },
         },
         enableEvents: false,
         restartWorkerOnError: false,
@@ -262,7 +262,7 @@ describe('Abstract pool test suite', () => {
         messageHandler: testHandler,
         errorHandler: testHandler,
         onlineHandler: testHandler,
-        exitHandler: testHandler
+        exitHandler: testHandler,
       }
     )
     expect(pool.emitter).toBeUndefined()
@@ -276,17 +276,17 @@ describe('Abstract pool test suite', () => {
         size: Math.pow(numberOfWorkers, 2),
         taskStealing: true,
         tasksStealingOnBackPressure: false,
-        tasksFinishedTimeout: 2000
+        tasksFinishedTimeout: 2000,
       },
       workerChoiceStrategy: WorkerChoiceStrategies.LEAST_USED,
       workerChoiceStrategyOptions: {
         runTime: { median: true },
-        weights: { 0: 300, 1: 200 }
+        weights: { 0: 300, 1: 200 },
       },
       onlineHandler: testHandler,
       messageHandler: testHandler,
       errorHandler: testHandler,
-      exitHandler: testHandler
+      exitHandler: testHandler,
     })
     for (const [, workerChoiceStrategy] of pool.workerChoiceStrategiesContext
       .workerChoiceStrategies) {
@@ -294,7 +294,7 @@ describe('Abstract pool test suite', () => {
         runTime: { median: true },
         waitTime: { median: false },
         elu: { median: false },
-        weights: { 0: 300, 1: 200 }
+        weights: { 0: 300, 1: 200 },
       })
     }
     await pool.destroy()
@@ -307,7 +307,7 @@ describe('Abstract pool test suite', () => {
           numberOfWorkers,
           './tests/worker-files/thread/testWorker.mjs',
           {
-            workerChoiceStrategy: 'invalidStrategy'
+            workerChoiceStrategy: 'invalidStrategy',
           }
         )
     ).toThrow(new Error("Invalid worker choice strategy 'invalidStrategy'"))
@@ -317,7 +317,7 @@ describe('Abstract pool test suite', () => {
           numberOfWorkers,
           './tests/worker-files/thread/testWorker.mjs',
           {
-            workerChoiceStrategyOptions: { weights: {} }
+            workerChoiceStrategyOptions: { weights: {} },
           }
         )
     ).toThrow(
@@ -331,7 +331,7 @@ describe('Abstract pool test suite', () => {
           numberOfWorkers,
           './tests/worker-files/thread/testWorker.mjs',
           {
-            workerChoiceStrategyOptions: { measurement: 'invalidMeasurement' }
+            workerChoiceStrategyOptions: { measurement: 'invalidMeasurement' },
           }
         )
     ).toThrow(
@@ -346,7 +346,7 @@ describe('Abstract pool test suite', () => {
           './tests/worker-files/thread/testWorker.mjs',
           {
             enableTasksQueue: true,
-            tasksQueueOptions: 'invalidTasksQueueOptions'
+            tasksQueueOptions: 'invalidTasksQueueOptions',
           }
         )
     ).toThrow(
@@ -359,7 +359,7 @@ describe('Abstract pool test suite', () => {
           './tests/worker-files/thread/testWorker.mjs',
           {
             enableTasksQueue: true,
-            tasksQueueOptions: { concurrency: 0 }
+            tasksQueueOptions: { concurrency: 0 },
           }
         )
     ).toThrow(
@@ -374,7 +374,7 @@ describe('Abstract pool test suite', () => {
           './tests/worker-files/thread/testWorker.mjs',
           {
             enableTasksQueue: true,
-            tasksQueueOptions: { concurrency: -1 }
+            tasksQueueOptions: { concurrency: -1 },
           }
         )
     ).toThrow(
@@ -389,7 +389,7 @@ describe('Abstract pool test suite', () => {
           './tests/worker-files/thread/testWorker.mjs',
           {
             enableTasksQueue: true,
-            tasksQueueOptions: { concurrency: 0.2 }
+            tasksQueueOptions: { concurrency: 0.2 },
           }
         )
     ).toThrow(
@@ -402,7 +402,7 @@ describe('Abstract pool test suite', () => {
           './tests/worker-files/thread/testWorker.mjs',
           {
             enableTasksQueue: true,
-            tasksQueueOptions: { size: 0 }
+            tasksQueueOptions: { size: 0 },
           }
         )
     ).toThrow(
@@ -417,7 +417,7 @@ describe('Abstract pool test suite', () => {
           './tests/worker-files/thread/testWorker.mjs',
           {
             enableTasksQueue: true,
-            tasksQueueOptions: { size: -1 }
+            tasksQueueOptions: { size: -1 },
           }
         )
     ).toThrow(
@@ -432,7 +432,7 @@ describe('Abstract pool test suite', () => {
           './tests/worker-files/thread/testWorker.mjs',
           {
             enableTasksQueue: true,
-            tasksQueueOptions: { size: 0.2 }
+            tasksQueueOptions: { size: 0.2 },
           }
         )
     ).toThrow(
@@ -455,8 +455,8 @@ describe('Abstract pool test suite', () => {
         elu: { median: false },
         weights: expect.objectContaining({
           0: expect.any(Number),
-          [pool.info.maxSize - 1]: expect.any(Number)
-        })
+          [pool.info.maxSize - 1]: expect.any(Number),
+        }),
       })
     }
     expect(
@@ -465,26 +465,26 @@ describe('Abstract pool test suite', () => {
       runTime: {
         aggregate: true,
         average: true,
-        median: false
+        median: false,
       },
       waitTime: {
         aggregate: true,
         average: true,
-        median: false
+        median: false,
       },
       elu: {
         aggregate: true,
         average: true,
-        median: false
-      }
+        median: false,
+      },
     })
     pool.setWorkerChoiceStrategyOptions({
       runTime: { median: true },
-      elu: { median: true }
+      elu: { median: true },
     })
     expect(pool.opts.workerChoiceStrategyOptions).toStrictEqual({
       runTime: { median: true },
-      elu: { median: true }
+      elu: { median: true },
     })
     for (const [, workerChoiceStrategy] of pool.workerChoiceStrategiesContext
       .workerChoiceStrategies) {
@@ -494,8 +494,8 @@ describe('Abstract pool test suite', () => {
         elu: { median: true },
         weights: expect.objectContaining({
           0: expect.any(Number),
-          [pool.info.maxSize - 1]: expect.any(Number)
-        })
+          [pool.info.maxSize - 1]: expect.any(Number),
+        }),
       })
     }
     expect(
@@ -504,26 +504,26 @@ describe('Abstract pool test suite', () => {
       runTime: {
         aggregate: true,
         average: false,
-        median: true
+        median: true,
       },
       waitTime: {
         aggregate: true,
         average: true,
-        median: false
+        median: false,
       },
       elu: {
         aggregate: true,
         average: false,
-        median: true
-      }
+        median: true,
+      },
     })
     pool.setWorkerChoiceStrategyOptions({
       runTime: { median: false },
-      elu: { median: false }
+      elu: { median: false },
     })
     expect(pool.opts.workerChoiceStrategyOptions).toStrictEqual({
       runTime: { median: false },
-      elu: { median: false }
+      elu: { median: false },
     })
     for (const [, workerChoiceStrategy] of pool.workerChoiceStrategiesContext
       .workerChoiceStrategies) {
@@ -533,8 +533,8 @@ describe('Abstract pool test suite', () => {
         elu: { median: false },
         weights: expect.objectContaining({
           0: expect.any(Number),
-          [pool.info.maxSize - 1]: expect.any(Number)
-        })
+          [pool.info.maxSize - 1]: expect.any(Number),
+        }),
       })
     }
     expect(
@@ -543,18 +543,18 @@ describe('Abstract pool test suite', () => {
       runTime: {
         aggregate: true,
         average: true,
-        median: false
+        median: false,
       },
       waitTime: {
         aggregate: true,
         average: true,
-        median: false
+        median: false,
       },
       elu: {
         aggregate: true,
         average: true,
-        median: false
-      }
+        median: false,
+      },
     })
     expect(() =>
       pool.setWorkerChoiceStrategyOptions('invalidWorkerChoiceStrategyOptions')
@@ -592,7 +592,7 @@ describe('Abstract pool test suite', () => {
       size: Math.pow(numberOfWorkers, 2),
       taskStealing: true,
       tasksStealingOnBackPressure: false,
-      tasksFinishedTimeout: 2000
+      tasksFinishedTimeout: 2000,
     })
     pool.enableTasksQueue(true, { concurrency: 2 })
     expect(pool.opts.enableTasksQueue).toBe(true)
@@ -601,7 +601,7 @@ describe('Abstract pool test suite', () => {
       size: Math.pow(numberOfWorkers, 2),
       taskStealing: true,
       tasksStealingOnBackPressure: false,
-      tasksFinishedTimeout: 2000
+      tasksFinishedTimeout: 2000,
     })
     pool.enableTasksQueue(false)
     expect(pool.opts.enableTasksQueue).toBe(false)
@@ -620,7 +620,7 @@ describe('Abstract pool test suite', () => {
       size: Math.pow(numberOfWorkers, 2),
       taskStealing: true,
       tasksStealingOnBackPressure: false,
-      tasksFinishedTimeout: 2000
+      tasksFinishedTimeout: 2000,
     })
     for (const workerNode of pool.workerNodes) {
       expect(workerNode.tasksQueueBackPressureSize).toBe(
@@ -632,14 +632,14 @@ describe('Abstract pool test suite', () => {
       size: 2,
       taskStealing: false,
       tasksStealingOnBackPressure: false,
-      tasksFinishedTimeout: 3000
+      tasksFinishedTimeout: 3000,
     })
     expect(pool.opts.tasksQueueOptions).toStrictEqual({
       concurrency: 2,
       size: 2,
       taskStealing: false,
       tasksStealingOnBackPressure: false,
-      tasksFinishedTimeout: 3000
+      tasksFinishedTimeout: 3000,
     })
     for (const workerNode of pool.workerNodes) {
       expect(workerNode.tasksQueueBackPressureSize).toBe(
@@ -649,14 +649,14 @@ describe('Abstract pool test suite', () => {
     pool.setTasksQueueOptions({
       concurrency: 1,
       taskStealing: true,
-      tasksStealingOnBackPressure: true
+      tasksStealingOnBackPressure: true,
     })
     expect(pool.opts.tasksQueueOptions).toStrictEqual({
       concurrency: 1,
       size: Math.pow(numberOfWorkers, 2),
       taskStealing: true,
       tasksStealingOnBackPressure: true,
-      tasksFinishedTimeout: 2000
+      tasksFinishedTimeout: 2000,
     })
     for (const workerNode of pool.workerNodes) {
       expect(workerNode.tasksQueueBackPressureSize).toBe(
@@ -715,7 +715,7 @@ describe('Abstract pool test suite', () => {
       busyWorkerNodes: 0,
       executedTasks: 0,
       executingTasks: 0,
-      failedTasks: 0
+      failedTasks: 0,
     })
     await pool.destroy()
     pool = new DynamicClusterPool(
@@ -738,7 +738,7 @@ describe('Abstract pool test suite', () => {
       busyWorkerNodes: 0,
       executedTasks: 0,
       executingTasks: 0,
-      failedTasks: 0
+      failedTasks: 0,
     })
     await pool.destroy()
   })
@@ -758,22 +758,22 @@ describe('Abstract pool test suite', () => {
           maxQueued: 0,
           sequentiallyStolen: 0,
           stolen: 0,
-          failed: 0
+          failed: 0,
         },
         runTime: {
-          history: expect.any(CircularBuffer)
+          history: expect.any(CircularBuffer),
         },
         waitTime: {
-          history: expect.any(CircularBuffer)
+          history: expect.any(CircularBuffer),
         },
         elu: {
           idle: {
-            history: expect.any(CircularBuffer)
+            history: expect.any(CircularBuffer),
           },
           active: {
-            history: expect.any(CircularBuffer)
-          }
-        }
+            history: expect.any(CircularBuffer),
+          },
+        },
       })
     }
     await pool.destroy()
@@ -822,7 +822,7 @@ describe('Abstract pool test suite', () => {
         dynamic: false,
         ready: true,
         stealing: false,
-        backPressure: false
+        backPressure: false,
       })
     }
     await pool.destroy()
@@ -839,7 +839,7 @@ describe('Abstract pool test suite', () => {
         dynamic: false,
         ready: true,
         stealing: false,
-        backPressure: false
+        backPressure: false,
       })
     }
     await pool.destroy()
@@ -868,7 +868,7 @@ describe('Abstract pool test suite', () => {
       numberOfWorkers,
       './tests/worker-files/cluster/testWorker.cjs',
       {
-        startWorkers: false
+        startWorkers: false,
       }
     )
     expect(pool.info.started).toBe(false)
@@ -932,22 +932,22 @@ describe('Abstract pool test suite', () => {
           maxQueued: 0,
           sequentiallyStolen: 0,
           stolen: 0,
-          failed: 0
+          failed: 0,
         },
         runTime: {
-          history: expect.any(CircularBuffer)
+          history: expect.any(CircularBuffer),
         },
         waitTime: {
-          history: expect.any(CircularBuffer)
+          history: expect.any(CircularBuffer),
         },
         elu: {
           idle: {
-            history: expect.any(CircularBuffer)
+            history: expect.any(CircularBuffer),
           },
           active: {
-            history: expect.any(CircularBuffer)
-          }
-        }
+            history: expect.any(CircularBuffer),
+          },
+        },
       })
     }
     await Promise.all(promises)
@@ -960,22 +960,22 @@ describe('Abstract pool test suite', () => {
           maxQueued: 0,
           sequentiallyStolen: 0,
           stolen: 0,
-          failed: 0
+          failed: 0,
         },
         runTime: {
-          history: expect.any(CircularBuffer)
+          history: expect.any(CircularBuffer),
         },
         waitTime: {
-          history: expect.any(CircularBuffer)
+          history: expect.any(CircularBuffer),
         },
         elu: {
           idle: {
-            history: expect.any(CircularBuffer)
+            history: expect.any(CircularBuffer),
           },
           active: {
-            history: expect.any(CircularBuffer)
-          }
-        }
+            history: expect.any(CircularBuffer),
+          },
+        },
       })
     }
     await pool.destroy()
@@ -1002,22 +1002,22 @@ describe('Abstract pool test suite', () => {
           maxQueued: 0,
           sequentiallyStolen: 0,
           stolen: 0,
-          failed: 0
+          failed: 0,
         },
         runTime: {
-          history: expect.any(CircularBuffer)
+          history: expect.any(CircularBuffer),
         },
         waitTime: {
-          history: expect.any(CircularBuffer)
+          history: expect.any(CircularBuffer),
         },
         elu: {
           idle: {
-            history: expect.any(CircularBuffer)
+            history: expect.any(CircularBuffer),
           },
           active: {
-            history: expect.any(CircularBuffer)
-          }
-        }
+            history: expect.any(CircularBuffer),
+          },
+        },
       })
       expect(workerNode.usage.tasks.executed).toBeGreaterThan(0)
       expect(workerNode.usage.tasks.executed).toBeLessThanOrEqual(
@@ -1034,22 +1034,22 @@ describe('Abstract pool test suite', () => {
           maxQueued: 0,
           sequentiallyStolen: 0,
           stolen: 0,
-          failed: 0
+          failed: 0,
         },
         runTime: {
-          history: expect.any(CircularBuffer)
+          history: expect.any(CircularBuffer),
         },
         waitTime: {
-          history: expect.any(CircularBuffer)
+          history: expect.any(CircularBuffer),
         },
         elu: {
           idle: {
-            history: expect.any(CircularBuffer)
+            history: expect.any(CircularBuffer),
           },
           active: {
-            history: expect.any(CircularBuffer)
-          }
-        }
+            history: expect.any(CircularBuffer),
+          },
+        },
       })
       expect(workerNode.usage.tasks.executed).toBeGreaterThan(0)
       expect(workerNode.usage.tasks.executed).toBeLessThanOrEqual(
@@ -1090,7 +1090,7 @@ describe('Abstract pool test suite', () => {
       busyWorkerNodes: expect.any(Number),
       executedTasks: expect.any(Number),
       executingTasks: expect.any(Number),
-      failedTasks: expect.any(Number)
+      failedTasks: expect.any(Number),
     })
     await pool.destroy()
   })
@@ -1131,7 +1131,7 @@ describe('Abstract pool test suite', () => {
       busyWorkerNodes: expect.any(Number),
       executedTasks: expect.any(Number),
       executingTasks: expect.any(Number),
-      failedTasks: expect.any(Number)
+      failedTasks: expect.any(Number),
     })
     await pool.destroy()
   })
@@ -1171,7 +1171,7 @@ describe('Abstract pool test suite', () => {
       busyWorkerNodes: expect.any(Number),
       executedTasks: expect.any(Number),
       executingTasks: expect.any(Number),
-      failedTasks: expect.any(Number)
+      failedTasks: expect.any(Number),
     })
     await pool.destroy()
   })
@@ -1181,7 +1181,7 @@ describe('Abstract pool test suite', () => {
       numberOfWorkers,
       './tests/worker-files/thread/testWorker.mjs',
       {
-        enableTasksQueue: true
+        enableTasksQueue: true,
       }
     )
     stub(pool, 'hasBackPressure').returns(true)
@@ -1219,7 +1219,7 @@ describe('Abstract pool test suite', () => {
       queuedTasks: expect.any(Number),
       backPressure: true,
       stolenTasks: expect.any(Number),
-      failedTasks: expect.any(Number)
+      failedTasks: expect.any(Number),
     })
     expect(pool.hasBackPressure.callCount).toBeGreaterThanOrEqual(7)
     await pool.destroy()
@@ -1232,7 +1232,7 @@ describe('Abstract pool test suite', () => {
       './tests/worker-files/thread/asyncWorker.mjs',
       {
         enableTasksQueue: true,
-        tasksQueueOptions: { tasksFinishedTimeout }
+        tasksQueueOptions: { tasksFinishedTimeout },
       }
     )
     const maxMultiplier = 4
@@ -1261,7 +1261,7 @@ describe('Abstract pool test suite', () => {
       './tests/worker-files/thread/asyncWorker.mjs',
       {
         enableTasksQueue: true,
-        tasksQueueOptions: { tasksFinishedTimeout }
+        tasksQueueOptions: { tasksFinishedTimeout },
       }
     )
     const maxMultiplier = 4
@@ -1303,7 +1303,7 @@ describe('Abstract pool test suite', () => {
       },
       promiseResolve () {
         if (executionAsyncId() === taskAsyncId) resolveCalls++
-      }
+      },
     })
     const pool = new FixedThreadPool(
       numberOfWorkers,
@@ -1379,7 +1379,7 @@ describe('Abstract pool test suite', () => {
     await expect(
       dynamicThreadPool.addTaskFunction('test', {
         taskFunction: () => {},
-        priority: -21
+        priority: -21,
       })
     ).rejects.toThrow(
       new RangeError("Property 'priority' must be between -20 and 19")
@@ -1387,7 +1387,7 @@ describe('Abstract pool test suite', () => {
     await expect(
       dynamicThreadPool.addTaskFunction('test', {
         taskFunction: () => {},
-        priority: 20
+        priority: 20,
       })
     ).rejects.toThrow(
       new RangeError("Property 'priority' must be between -20 and 19")
@@ -1395,17 +1395,17 @@ describe('Abstract pool test suite', () => {
     await expect(
       dynamicThreadPool.addTaskFunction('test', {
         taskFunction: () => {},
-        strategy: 'invalidStrategy'
+        strategy: 'invalidStrategy',
       })
     ).rejects.toThrow(
       new Error("Invalid worker choice strategy 'invalidStrategy'")
     )
     expect(dynamicThreadPool.listTaskFunctionsProperties()).toStrictEqual([
       { name: DEFAULT_TASK_NAME },
-      { name: 'test' }
+      { name: 'test' },
     ])
     expect([
-      ...dynamicThreadPool.workerChoiceStrategiesContext.workerChoiceStrategies.keys()
+      ...dynamicThreadPool.workerChoiceStrategiesContext.workerChoiceStrategies.keys(),
     ]).toStrictEqual([WorkerChoiceStrategies.ROUND_ROBIN])
     const echoTaskFunction = data => {
       return data
@@ -1413,24 +1413,24 @@ describe('Abstract pool test suite', () => {
     await expect(
       dynamicThreadPool.addTaskFunction('echo', {
         taskFunction: echoTaskFunction,
-        strategy: WorkerChoiceStrategies.LEAST_ELU
+        strategy: WorkerChoiceStrategies.LEAST_ELU,
       })
     ).resolves.toBe(true)
     expect(dynamicThreadPool.taskFunctions.size).toBe(1)
     expect(dynamicThreadPool.taskFunctions.get('echo')).toStrictEqual({
       taskFunction: echoTaskFunction,
-      strategy: WorkerChoiceStrategies.LEAST_ELU
+      strategy: WorkerChoiceStrategies.LEAST_ELU,
     })
     expect([
-      ...dynamicThreadPool.workerChoiceStrategiesContext.workerChoiceStrategies.keys()
+      ...dynamicThreadPool.workerChoiceStrategiesContext.workerChoiceStrategies.keys(),
     ]).toStrictEqual([
       WorkerChoiceStrategies.ROUND_ROBIN,
-      WorkerChoiceStrategies.LEAST_ELU
+      WorkerChoiceStrategies.LEAST_ELU,
     ])
     expect(dynamicThreadPool.listTaskFunctionsProperties()).toStrictEqual([
       { name: DEFAULT_TASK_NAME },
       { name: 'test' },
-      { name: 'echo', strategy: WorkerChoiceStrategies.LEAST_ELU }
+      { name: 'echo', strategy: WorkerChoiceStrategies.LEAST_ELU },
     ])
     const taskFunctionData = { test: 'test' }
     const echoResult = await dynamicThreadPool.execute(taskFunctionData, 'echo')
@@ -1443,22 +1443,22 @@ describe('Abstract pool test suite', () => {
           queued: 0,
           sequentiallyStolen: 0,
           stolen: 0,
-          failed: 0
+          failed: 0,
         },
         runTime: {
-          history: expect.any(CircularBuffer)
+          history: expect.any(CircularBuffer),
         },
         waitTime: {
-          history: expect.any(CircularBuffer)
+          history: expect.any(CircularBuffer),
         },
         elu: expect.objectContaining({
           idle: expect.objectContaining({
-            history: expect.any(CircularBuffer)
+            history: expect.any(CircularBuffer),
           }),
           active: expect.objectContaining({
-            history: expect.any(CircularBuffer)
-          })
-        })
+            history: expect.any(CircularBuffer),
+          }),
+        }),
       })
       expect(
         workerNode.getTaskFunctionWorkerUsage('echo').tasks.executed
@@ -1513,7 +1513,7 @@ describe('Abstract pool test suite', () => {
     await waitPoolEvents(dynamicThreadPool, PoolEvents.ready, 1)
     expect(dynamicThreadPool.listTaskFunctionsProperties()).toStrictEqual([
       { name: DEFAULT_TASK_NAME },
-      { name: 'test' }
+      { name: 'test' },
     ])
     await expect(dynamicThreadPool.removeTaskFunction('test')).rejects.toThrow(
       new Error('Cannot remove a task function not handled on the pool side')
@@ -1523,23 +1523,23 @@ describe('Abstract pool test suite', () => {
     }
     await dynamicThreadPool.addTaskFunction('echo', {
       taskFunction: echoTaskFunction,
-      strategy: WorkerChoiceStrategies.LEAST_ELU
+      strategy: WorkerChoiceStrategies.LEAST_ELU,
     })
     expect(dynamicThreadPool.taskFunctions.size).toBe(1)
     expect(dynamicThreadPool.taskFunctions.get('echo')).toStrictEqual({
       taskFunction: echoTaskFunction,
-      strategy: WorkerChoiceStrategies.LEAST_ELU
+      strategy: WorkerChoiceStrategies.LEAST_ELU,
     })
     expect([
-      ...dynamicThreadPool.workerChoiceStrategiesContext.workerChoiceStrategies.keys()
+      ...dynamicThreadPool.workerChoiceStrategiesContext.workerChoiceStrategies.keys(),
     ]).toStrictEqual([
       WorkerChoiceStrategies.ROUND_ROBIN,
-      WorkerChoiceStrategies.LEAST_ELU
+      WorkerChoiceStrategies.LEAST_ELU,
     ])
     expect(dynamicThreadPool.listTaskFunctionsProperties()).toStrictEqual([
       { name: DEFAULT_TASK_NAME },
       { name: 'test' },
-      { name: 'echo', strategy: WorkerChoiceStrategies.LEAST_ELU }
+      { name: 'echo', strategy: WorkerChoiceStrategies.LEAST_ELU },
     ])
     await expect(dynamicThreadPool.removeTaskFunction('echo')).resolves.toBe(
       true
@@ -1547,11 +1547,11 @@ describe('Abstract pool test suite', () => {
     expect(dynamicThreadPool.taskFunctions.size).toBe(0)
     expect(dynamicThreadPool.taskFunctions.get('echo')).toBeUndefined()
     expect([
-      ...dynamicThreadPool.workerChoiceStrategiesContext.workerChoiceStrategies.keys()
+      ...dynamicThreadPool.workerChoiceStrategiesContext.workerChoiceStrategies.keys(),
     ]).toStrictEqual([WorkerChoiceStrategies.ROUND_ROBIN])
     expect(dynamicThreadPool.listTaskFunctionsProperties()).toStrictEqual([
       { name: DEFAULT_TASK_NAME },
-      { name: 'test' }
+      { name: 'test' },
     ])
     await dynamicThreadPool.destroy()
   })
@@ -1567,7 +1567,7 @@ describe('Abstract pool test suite', () => {
       { name: DEFAULT_TASK_NAME },
       { name: 'jsonIntegerSerialization' },
       { name: 'factorial' },
-      { name: 'fibonacci' }
+      { name: 'fibonacci' },
     ])
     await dynamicThreadPool.destroy()
     const fixedClusterPool = new FixedClusterPool(
@@ -1579,7 +1579,7 @@ describe('Abstract pool test suite', () => {
       { name: DEFAULT_TASK_NAME },
       { name: 'jsonIntegerSerialization' },
       { name: 'factorial' },
-      { name: 'fibonacci' }
+      { name: 'fibonacci' },
     ])
     await fixedClusterPool.destroy()
   })
@@ -1615,7 +1615,7 @@ describe('Abstract pool test suite', () => {
       { name: DEFAULT_TASK_NAME },
       { name: 'jsonIntegerSerialization' },
       { name: 'factorial' },
-      { name: 'fibonacci' }
+      { name: 'fibonacci' },
     ])
     await expect(
       dynamicThreadPool.setDefaultTaskFunction('factorial')
@@ -1624,7 +1624,7 @@ describe('Abstract pool test suite', () => {
       { name: DEFAULT_TASK_NAME },
       { name: 'factorial' },
       { name: 'jsonIntegerSerialization' },
-      { name: 'fibonacci' }
+      { name: 'fibonacci' },
     ])
     await expect(
       dynamicThreadPool.setDefaultTaskFunction('fibonacci')
@@ -1633,7 +1633,7 @@ describe('Abstract pool test suite', () => {
       { name: DEFAULT_TASK_NAME },
       { name: 'fibonacci' },
       { name: 'jsonIntegerSerialization' },
-      { name: 'factorial' }
+      { name: 'factorial' },
     ])
     await dynamicThreadPool.destroy()
   })
@@ -1660,7 +1660,7 @@ describe('Abstract pool test suite', () => {
         { name: DEFAULT_TASK_NAME },
         { name: 'jsonIntegerSerialization' },
         { name: 'factorial' },
-        { name: 'fibonacci' }
+        { name: 'fibonacci' },
       ])
       expect(workerNode.taskFunctionsUsage.size).toBe(3)
       expect(workerNode.usage.tasks.executed).toBeGreaterThan(0)
@@ -1675,22 +1675,22 @@ describe('Abstract pool test suite', () => {
             failed: 0,
             queued: 0,
             sequentiallyStolen: 0,
-            stolen: 0
+            stolen: 0,
           },
           runTime: {
-            history: expect.any(CircularBuffer)
+            history: expect.any(CircularBuffer),
           },
           waitTime: {
-            history: expect.any(CircularBuffer)
+            history: expect.any(CircularBuffer),
           },
           elu: {
             idle: {
-              history: expect.any(CircularBuffer)
+              history: expect.any(CircularBuffer),
             },
             active: {
-              history: expect.any(CircularBuffer)
-            }
-          }
+              history: expect.any(CircularBuffer),
+            },
+          },
         })
         expect(
           workerNode.getTaskFunctionWorkerUsage(taskFunctionProperties.name)
@@ -1730,7 +1730,7 @@ describe('Abstract pool test suite', () => {
         { name: DEFAULT_TASK_NAME },
         { name: 'jsonIntegerSerialization' },
         { name: 'factorial' },
-        { name: 'fibonacci', priority: -5 }
+        { name: 'fibonacci', priority: -5 },
       ])
       expect(workerNode.taskFunctionsUsage.size).toBe(3)
       expect(workerNode.usage.tasks.executed).toBeGreaterThan(0)
@@ -1745,22 +1745,22 @@ describe('Abstract pool test suite', () => {
             failed: 0,
             queued: 0,
             sequentiallyStolen: 0,
-            stolen: 0
+            stolen: 0,
           },
           runTime: {
-            history: expect.any(CircularBuffer)
+            history: expect.any(CircularBuffer),
           },
           waitTime: {
-            history: expect.any(CircularBuffer)
+            history: expect.any(CircularBuffer),
           },
           elu: {
             idle: {
-              history: expect.any(CircularBuffer)
+              history: expect.any(CircularBuffer),
             },
             active: {
-              history: expect.any(CircularBuffer)
-            }
-          }
+              history: expect.any(CircularBuffer),
+            },
+          },
         })
         expect(
           workerNode.getTaskFunctionWorkerUsage(taskFunctionProperties.name)
@@ -1802,7 +1802,7 @@ describe('Abstract pool test suite', () => {
       pool.sendTaskFunctionOperationToWorker(workerNodeKey, {
         taskFunctionOperation: 'add',
         taskFunctionProperties: { name: 'empty' },
-        taskFunction: (() => {}).toString()
+        taskFunction: (() => {}).toString(),
       })
     ).resolves.toBe(true)
     expect(
@@ -1810,7 +1810,7 @@ describe('Abstract pool test suite', () => {
     ).toStrictEqual([
       { name: DEFAULT_TASK_NAME },
       { name: 'test' },
-      { name: 'empty' }
+      { name: 'empty' },
     ])
     await pool.destroy()
   })
@@ -1825,14 +1825,14 @@ describe('Abstract pool test suite', () => {
       pool.sendTaskFunctionOperationToWorkers({
         taskFunctionOperation: 'add',
         taskFunctionProperties: { name: 'empty' },
-        taskFunction: (() => {}).toString()
+        taskFunction: (() => {}).toString(),
       })
     ).resolves.toBe(true)
     for (const workerNode of pool.workerNodes) {
       expect(workerNode.info.taskFunctionsProperties).toStrictEqual([
         { name: DEFAULT_TASK_NAME },
         { name: 'test' },
-        { name: 'empty' }
+        { name: 'empty' },
       ])
     }
     await pool.destroy()
index 166498f9a0b0c4c7a9f4a997f3d296518e3ca457..f509445220fda049d96e52bbd37b95dbae0a4094 100644 (file)
@@ -3,7 +3,7 @@ import { expect } from 'expect'
 import {
   DynamicClusterPool,
   PoolEvents,
-  WorkerChoiceStrategies
+  WorkerChoiceStrategies,
 } from '../../../lib/index.cjs'
 import { TaskFunctions } from '../../test-types.cjs'
 import { sleep, waitPoolEvents, waitWorkerEvents } from '../../test-utils.cjs'
@@ -16,17 +16,17 @@ describe('Dynamic cluster pool test suite', () => {
     max,
     './tests/worker-files/cluster/testWorker.cjs',
     {
-      errorHandler: e => console.error(e)
+      errorHandler: e => console.error(e),
     }
   )
 
   it('Verify that the function is executed in a worker cluster', async () => {
     let result = await pool.execute({
-      function: TaskFunctions.fibonacci
+      function: TaskFunctions.fibonacci,
     })
     expect(result).toBe(354224848179262000000)
     result = await pool.execute({
-      function: TaskFunctions.factorial
+      function: TaskFunctions.factorial,
     })
     expect(result).toBe(9.33262154439441e157)
   })
@@ -67,14 +67,14 @@ describe('Dynamic cluster pool test suite', () => {
     pool.emitter.on(PoolEvents.destroy, () => ++poolDestroy)
     expect(pool.emitter.eventNames()).toStrictEqual([
       PoolEvents.busy,
-      PoolEvents.destroy
+      PoolEvents.destroy,
     ])
     await pool.destroy()
     const numberOfExitEvents = await exitPromise
     expect(pool.started).toBe(false)
     expect(pool.emitter.eventNames()).toStrictEqual([
       PoolEvents.busy,
-      PoolEvents.destroy
+      PoolEvents.destroy,
     ])
     expect(pool.readyEventEmitted).toBe(false)
     expect(pool.workerNodes.length).toBe(0)
@@ -108,7 +108,7 @@ describe('Dynamic cluster pool test suite', () => {
       {
         errorHandler: e => console.error(e),
         onlineHandler: () => console.info('long executing worker is online'),
-        exitHandler: () => console.info('long executing worker exited')
+        exitHandler: () => console.info('long executing worker exited'),
       }
     )
     expect(longRunningPool.workerNodes.length).toBe(min)
@@ -136,7 +136,7 @@ describe('Dynamic cluster pool test suite', () => {
       {
         errorHandler: e => console.error(e),
         onlineHandler: () => console.info('long executing worker is online'),
-        exitHandler: () => console.info('long executing worker exited')
+        exitHandler: () => console.info('long executing worker exited'),
       }
     )
     expect(longRunningPool.workerNodes.length).toBe(min)
@@ -169,12 +169,13 @@ describe('Dynamic cluster pool test suite', () => {
         max,
         './tests/worker-files/cluster/testWorker.cjs',
         {
-          workerChoiceStrategy
+          workerChoiceStrategy,
         }
       )
       expect(pool.starting).toBe(false)
       expect(pool.readyEventEmitted).toBe(false)
       for (let run = 0; run < 2; run++) {
+        // eslint-disable-next-line @typescript-eslint/no-unused-expressions
         run % 2 !== 0 && pool.enableTasksQueue(true)
         const maxMultiplier = 4
         const promises = new Set()
index 0397c797d53a547d1cf560c4520de2cadfafdd1e..a78a4509fb263b987d08e5cb0e9d1e7f6d607070 100644 (file)
@@ -14,7 +14,7 @@ describe('Fixed cluster pool test suite', () => {
     numberOfWorkers,
     './tests/worker-files/cluster/testWorker.cjs',
     {
-      errorHandler: e => console.error(e)
+      errorHandler: e => console.error(e),
     }
   )
   const queuePool = new FixedClusterPool(
@@ -23,9 +23,9 @@ describe('Fixed cluster pool test suite', () => {
     {
       enableTasksQueue: true,
       tasksQueueOptions: {
-        concurrency: tasksConcurrency
+        concurrency: tasksConcurrency,
       },
-      errorHandler: e => console.error(e)
+      errorHandler: e => console.error(e),
     }
   )
   const emptyPool = new FixedClusterPool(
@@ -41,14 +41,14 @@ describe('Fixed cluster pool test suite', () => {
     numberOfWorkers,
     './tests/worker-files/cluster/errorWorker.cjs',
     {
-      errorHandler: e => console.error(e)
+      errorHandler: e => console.error(e),
     }
   )
   const asyncErrorPool = new FixedClusterPool(
     numberOfWorkers,
     './tests/worker-files/cluster/asyncErrorWorker.cjs',
     {
-      errorHandler: e => console.error(e)
+      errorHandler: e => console.error(e),
     }
   )
   const asyncPool = new FixedClusterPool(
@@ -68,11 +68,11 @@ describe('Fixed cluster pool test suite', () => {
 
   it('Verify that the function is executed in a worker cluster', async () => {
     let result = await pool.execute({
-      function: TaskFunctions.fibonacci
+      function: TaskFunctions.fibonacci,
     })
     expect(result).toBe(354224848179262000000)
     result = await pool.execute({
-      function: TaskFunctions.factorial
+      function: TaskFunctions.factorial,
     })
     expect(result).toBe(9.33262154439441e157)
   })
@@ -87,7 +87,7 @@ describe('Fixed cluster pool test suite', () => {
       numberOfWorkers,
       './tests/worker-files/cluster/testWorker.cjs',
       {
-        errorHandler: e => console.error(e)
+        errorHandler: e => console.error(e),
       }
     )
     expect(pool.emitter.eventNames()).toStrictEqual([])
@@ -211,7 +211,7 @@ describe('Fixed cluster pool test suite', () => {
     expect(taskError).toStrictEqual({
       name: DEFAULT_TASK_NAME,
       message: 'Error Message from ClusterWorker',
-      data
+      data,
     })
     expect(
       errorPool.workerNodes.some(
@@ -228,7 +228,7 @@ describe('Fixed cluster pool test suite', () => {
       taskError = e
     })
     expect(asyncErrorPool.emitter.eventNames()).toStrictEqual([
-      PoolEvents.taskError
+      PoolEvents.taskError,
     ])
     let inError
     try {
@@ -242,7 +242,7 @@ describe('Fixed cluster pool test suite', () => {
     expect(taskError).toStrictEqual({
       name: DEFAULT_TASK_NAME,
       message: 'Error Message from ClusterWorker:async',
-      data
+      data,
     })
     expect(
       asyncErrorPool.workerNodes.some(
@@ -267,14 +267,14 @@ describe('Fixed cluster pool test suite', () => {
     pool.emitter.on(PoolEvents.destroy, () => ++poolDestroy)
     expect(pool.emitter.eventNames()).toStrictEqual([
       PoolEvents.busy,
-      PoolEvents.destroy
+      PoolEvents.destroy,
     ])
     await pool.destroy()
     const numberOfExitEvents = await exitPromise
     expect(pool.started).toBe(false)
     expect(pool.emitter.eventNames()).toStrictEqual([
       PoolEvents.busy,
-      PoolEvents.destroy
+      PoolEvents.destroy,
     ])
     expect(pool.readyEventEmitted).toBe(false)
     expect(pool.workerNodes.length).toBe(0)
@@ -289,22 +289,22 @@ describe('Fixed cluster pool test suite', () => {
     expect(pool.opts.settings).toBeUndefined()
     expect(cluster.settings).toMatchObject({
       exec: workerFilePath,
-      silent: false
+      silent: false,
     })
     await pool.destroy()
     pool = new FixedClusterPool(numberOfWorkers, workerFilePath, {
       env: { TEST: 'test' },
-      settings: { args: ['--use', 'http'], silent: true }
+      settings: { args: ['--use', 'http'], silent: true },
     })
     expect(pool.opts.env).toStrictEqual({ TEST: 'test' })
     expect(pool.opts.settings).toStrictEqual({
       args: ['--use', 'http'],
-      silent: true
+      silent: true,
     })
     expect(cluster.settings).toMatchObject({
       args: ['--use', 'http'],
       silent: true,
-      exec: workerFilePath
+      exec: workerFilePath,
     })
     await pool.destroy()
   })
index dc6fc71fefca8b32a636d02d7a2dd757c4e838ca..9b57e78945baac77c4c522f54147560552703579 100644 (file)
@@ -3,7 +3,7 @@ import { expect } from 'expect'
 import { FixedClusterPool, FixedThreadPool } from '../../../lib/index.cjs'
 import {
   buildWorkerChoiceStrategyOptions,
-  getWorkerChoiceStrategiesRetries
+  getWorkerChoiceStrategiesRetries,
 } from '../../../lib/pools/selection-strategies/selection-strategies-utils.cjs'
 
 describe('Selection strategies utils test suite', () => {
@@ -19,8 +19,8 @@ describe('Selection strategies utils test suite', () => {
       elu: { median: false },
       weights: expect.objectContaining({
         0: expect.any(Number),
-        [pool.info.maxSize - 1]: expect.any(Number)
-      })
+        [pool.info.maxSize - 1]: expect.any(Number),
+      }),
     })
     const workerChoiceStrategyOptions = {
       runTime: { median: true },
@@ -28,8 +28,8 @@ describe('Selection strategies utils test suite', () => {
       elu: { median: true },
       weights: {
         0: 100,
-        1: 100
-      }
+        1: 100,
+      },
     }
     expect(
       buildWorkerChoiceStrategyOptions(pool, workerChoiceStrategyOptions)
@@ -50,8 +50,8 @@ describe('Selection strategies utils test suite', () => {
       elu: { median: true },
       weights: {
         0: 100,
-        1: 100
-      }
+        1: 100,
+      },
     }
     expect(
       getWorkerChoiceStrategiesRetries(pool, workerChoiceStrategyOptions)
index 3f2f2e81cf5b41bb4122adbda737b9b086ebd511..e8df7e1a5c35baa931595bb49493f5ba28e4fd5c 100644 (file)
@@ -8,7 +8,7 @@ import {
   DynamicThreadPool,
   FixedClusterPool,
   FixedThreadPool,
-  WorkerChoiceStrategies
+  WorkerChoiceStrategies,
 } from '../../../lib/index.cjs'
 
 describe('Selection strategies test suite', () => {
@@ -159,7 +159,7 @@ describe('Selection strategies test suite', () => {
     )
     expect(pool.workerChoiceStrategiesContext.getPolicy()).toStrictEqual({
       dynamicWorkerUsage: false,
-      dynamicWorkerReady: true
+      dynamicWorkerReady: true,
     })
     await pool.destroy()
     pool = new DynamicThreadPool(
@@ -170,7 +170,7 @@ describe('Selection strategies test suite', () => {
     )
     expect(pool.workerChoiceStrategiesContext.getPolicy()).toStrictEqual({
       dynamicWorkerUsage: false,
-      dynamicWorkerReady: true
+      dynamicWorkerReady: true,
     })
     // We need to clean up the resources after our test
     await pool.destroy()
@@ -189,18 +189,18 @@ describe('Selection strategies test suite', () => {
       runTime: {
         aggregate: false,
         average: false,
-        median: false
+        median: false,
       },
       waitTime: {
         aggregate: false,
         average: false,
-        median: false
+        median: false,
       },
       elu: {
         aggregate: false,
         average: false,
-        median: false
-      }
+        median: false,
+      },
     })
     await pool.destroy()
     pool = new DynamicThreadPool(
@@ -215,18 +215,18 @@ describe('Selection strategies test suite', () => {
       runTime: {
         aggregate: false,
         average: false,
-        median: false
+        median: false,
       },
       waitTime: {
         aggregate: false,
         average: false,
-        median: false
+        median: false,
       },
       elu: {
         aggregate: false,
         average: false,
-        median: false
-      }
+        median: false,
+      },
     })
     // We need to clean up the resources after our test
     await pool.destroy()
@@ -255,22 +255,22 @@ describe('Selection strategies test suite', () => {
           maxQueued: 0,
           sequentiallyStolen: 0,
           stolen: 0,
-          failed: 0
+          failed: 0,
         },
         runTime: {
-          history: expect.any(CircularBuffer)
+          history: expect.any(CircularBuffer),
         },
         waitTime: {
-          history: expect.any(CircularBuffer)
+          history: expect.any(CircularBuffer),
         },
         elu: {
           idle: {
-            history: expect.any(CircularBuffer)
+            history: expect.any(CircularBuffer),
           },
           active: {
-            history: expect.any(CircularBuffer)
-          }
-        }
+            history: expect.any(CircularBuffer),
+          },
+        },
       })
     }
     expect(
@@ -311,22 +311,22 @@ describe('Selection strategies test suite', () => {
           maxQueued: 0,
           sequentiallyStolen: 0,
           stolen: 0,
-          failed: 0
+          failed: 0,
         },
         runTime: {
-          history: expect.any(CircularBuffer)
+          history: expect.any(CircularBuffer),
         },
         waitTime: {
-          history: expect.any(CircularBuffer)
+          history: expect.any(CircularBuffer),
         },
         elu: {
           idle: {
-            history: expect.any(CircularBuffer)
+            history: expect.any(CircularBuffer),
           },
           active: {
-            history: expect.any(CircularBuffer)
-          }
-        }
+            history: expect.any(CircularBuffer),
+          },
+        },
       })
       expect(workerNode.usage.tasks.executed).toBeGreaterThanOrEqual(0)
       expect(workerNode.usage.tasks.executed).toBeLessThanOrEqual(
@@ -434,7 +434,7 @@ describe('Selection strategies test suite', () => {
     )
     expect(pool.workerChoiceStrategiesContext.getPolicy()).toStrictEqual({
       dynamicWorkerUsage: false,
-      dynamicWorkerReady: true
+      dynamicWorkerReady: true,
     })
     await pool.destroy()
     pool = new DynamicThreadPool(
@@ -445,7 +445,7 @@ describe('Selection strategies test suite', () => {
     )
     expect(pool.workerChoiceStrategiesContext.getPolicy()).toStrictEqual({
       dynamicWorkerUsage: false,
-      dynamicWorkerReady: true
+      dynamicWorkerReady: true,
     })
     // We need to clean up the resources after our test
     await pool.destroy()
@@ -464,18 +464,18 @@ describe('Selection strategies test suite', () => {
       runTime: {
         aggregate: false,
         average: false,
-        median: false
+        median: false,
       },
       waitTime: {
         aggregate: false,
         average: false,
-        median: false
+        median: false,
       },
       elu: {
         aggregate: false,
         average: false,
-        median: false
-      }
+        median: false,
+      },
     })
     await pool.destroy()
     pool = new DynamicThreadPool(
@@ -490,18 +490,18 @@ describe('Selection strategies test suite', () => {
       runTime: {
         aggregate: false,
         average: false,
-        median: false
+        median: false,
       },
       waitTime: {
         aggregate: false,
         average: false,
-        median: false
+        median: false,
       },
       elu: {
         aggregate: false,
         average: false,
-        median: false
-      }
+        median: false,
+      },
     })
     // We need to clean up the resources after our test
     await pool.destroy()
@@ -529,22 +529,22 @@ describe('Selection strategies test suite', () => {
           maxQueued: 0,
           sequentiallyStolen: 0,
           stolen: 0,
-          failed: 0
+          failed: 0,
         },
         runTime: {
-          history: expect.any(CircularBuffer)
+          history: expect.any(CircularBuffer),
         },
         waitTime: {
-          history: expect.any(CircularBuffer)
+          history: expect.any(CircularBuffer),
         },
         elu: {
           idle: {
-            history: expect.any(CircularBuffer)
+            history: expect.any(CircularBuffer),
           },
           active: {
-            history: expect.any(CircularBuffer)
-          }
-        }
+            history: expect.any(CircularBuffer),
+          },
+        },
       })
       expect(workerNode.usage.tasks.executed).toBeGreaterThanOrEqual(0)
       expect(workerNode.usage.tasks.executed).toBeLessThanOrEqual(
@@ -588,22 +588,22 @@ describe('Selection strategies test suite', () => {
           maxQueued: 0,
           sequentiallyStolen: 0,
           stolen: 0,
-          failed: 0
+          failed: 0,
         },
         runTime: {
-          history: expect.any(CircularBuffer)
+          history: expect.any(CircularBuffer),
         },
         waitTime: {
-          history: expect.any(CircularBuffer)
+          history: expect.any(CircularBuffer),
         },
         elu: {
           idle: {
-            history: expect.any(CircularBuffer)
+            history: expect.any(CircularBuffer),
           },
           active: {
-            history: expect.any(CircularBuffer)
-          }
-        }
+            history: expect.any(CircularBuffer),
+          },
+        },
       })
       expect(workerNode.usage.tasks.executed).toBeGreaterThanOrEqual(0)
       expect(workerNode.usage.tasks.executed).toBeLessThanOrEqual(
@@ -633,7 +633,7 @@ describe('Selection strategies test suite', () => {
     )
     expect(pool.workerChoiceStrategiesContext.getPolicy()).toStrictEqual({
       dynamicWorkerUsage: false,
-      dynamicWorkerReady: true
+      dynamicWorkerReady: true,
     })
     await pool.destroy()
     pool = new DynamicThreadPool(
@@ -644,7 +644,7 @@ describe('Selection strategies test suite', () => {
     )
     expect(pool.workerChoiceStrategiesContext.getPolicy()).toStrictEqual({
       dynamicWorkerUsage: false,
-      dynamicWorkerReady: true
+      dynamicWorkerReady: true,
     })
     // We need to clean up the resources after our test
     await pool.destroy()
@@ -663,18 +663,18 @@ describe('Selection strategies test suite', () => {
       runTime: {
         aggregate: true,
         average: false,
-        median: false
+        median: false,
       },
       waitTime: {
         aggregate: true,
         average: false,
-        median: false
+        median: false,
       },
       elu: {
         aggregate: false,
         average: false,
-        median: false
-      }
+        median: false,
+      },
     })
     await pool.destroy()
     pool = new DynamicThreadPool(
@@ -689,18 +689,18 @@ describe('Selection strategies test suite', () => {
       runTime: {
         aggregate: true,
         average: false,
-        median: false
+        median: false,
       },
       waitTime: {
         aggregate: true,
         average: false,
-        median: false
+        median: false,
       },
       elu: {
         aggregate: false,
         average: false,
-        median: false
-      }
+        median: false,
+      },
     })
     // We need to clean up the resources after our test
     await pool.destroy()
@@ -728,22 +728,22 @@ describe('Selection strategies test suite', () => {
           maxQueued: 0,
           sequentiallyStolen: 0,
           stolen: 0,
-          failed: 0
+          failed: 0,
         },
         runTime: expect.objectContaining({
-          history: expect.any(CircularBuffer)
+          history: expect.any(CircularBuffer),
         }),
         waitTime: expect.objectContaining({
-          history: expect.any(CircularBuffer)
+          history: expect.any(CircularBuffer),
         }),
         elu: {
           idle: {
-            history: expect.any(CircularBuffer)
+            history: expect.any(CircularBuffer),
           },
           active: {
-            history: expect.any(CircularBuffer)
-          }
-        }
+            history: expect.any(CircularBuffer),
+          },
+        },
       })
       expect(workerNode.usage.tasks.executed).toBeGreaterThanOrEqual(0)
       expect(workerNode.usage.tasks.executed).toBeLessThanOrEqual(
@@ -797,22 +797,22 @@ describe('Selection strategies test suite', () => {
           maxQueued: 0,
           sequentiallyStolen: 0,
           stolen: 0,
-          failed: 0
+          failed: 0,
         },
         runTime: expect.objectContaining({
-          history: expect.any(CircularBuffer)
+          history: expect.any(CircularBuffer),
         }),
         waitTime: expect.objectContaining({
-          history: expect.any(CircularBuffer)
+          history: expect.any(CircularBuffer),
         }),
         elu: {
           idle: {
-            history: expect.any(CircularBuffer)
+            history: expect.any(CircularBuffer),
           },
           active: {
-            history: expect.any(CircularBuffer)
-          }
-        }
+            history: expect.any(CircularBuffer),
+          },
+        },
       })
       expect(workerNode.usage.tasks.executed).toBeGreaterThanOrEqual(0)
       expect(workerNode.usage.tasks.executed).toBeLessThanOrEqual(
@@ -852,7 +852,7 @@ describe('Selection strategies test suite', () => {
     )
     expect(pool.workerChoiceStrategiesContext.getPolicy()).toStrictEqual({
       dynamicWorkerUsage: false,
-      dynamicWorkerReady: true
+      dynamicWorkerReady: true,
     })
     await pool.destroy()
     pool = new DynamicThreadPool(
@@ -863,7 +863,7 @@ describe('Selection strategies test suite', () => {
     )
     expect(pool.workerChoiceStrategiesContext.getPolicy()).toStrictEqual({
       dynamicWorkerUsage: false,
-      dynamicWorkerReady: true
+      dynamicWorkerReady: true,
     })
     // We need to clean up the resources after our test
     await pool.destroy()
@@ -882,18 +882,18 @@ describe('Selection strategies test suite', () => {
       runTime: {
         aggregate: false,
         average: false,
-        median: false
+        median: false,
       },
       waitTime: {
         aggregate: false,
         average: false,
-        median: false
+        median: false,
       },
       elu: {
         aggregate: true,
         average: false,
-        median: false
-      }
+        median: false,
+      },
     })
     await pool.destroy()
     pool = new DynamicThreadPool(
@@ -908,18 +908,18 @@ describe('Selection strategies test suite', () => {
       runTime: {
         aggregate: false,
         average: false,
-        median: false
+        median: false,
       },
       waitTime: {
         aggregate: false,
         average: false,
-        median: false
+        median: false,
       },
       elu: {
         aggregate: true,
         average: false,
-        median: false
-      }
+        median: false,
+      },
     })
     // We need to clean up the resources after our test
     await pool.destroy()
@@ -947,22 +947,22 @@ describe('Selection strategies test suite', () => {
           maxQueued: 0,
           sequentiallyStolen: 0,
           stolen: 0,
-          failed: 0
+          failed: 0,
         },
         runTime: {
-          history: expect.any(CircularBuffer)
+          history: expect.any(CircularBuffer),
         },
         waitTime: {
-          history: expect.any(CircularBuffer)
+          history: expect.any(CircularBuffer),
         },
         elu: expect.objectContaining({
           idle: expect.objectContaining({
-            history: expect.any(CircularBuffer)
+            history: expect.any(CircularBuffer),
           }),
           active: expect.objectContaining({
-            history: expect.any(CircularBuffer)
-          })
-        })
+            history: expect.any(CircularBuffer),
+          }),
+        }),
       })
       expect(workerNode.usage.tasks.executed).toBeGreaterThanOrEqual(0)
       expect(workerNode.usage.tasks.executed).toBeLessThanOrEqual(
@@ -1022,22 +1022,22 @@ describe('Selection strategies test suite', () => {
           maxQueued: 0,
           sequentiallyStolen: 0,
           stolen: 0,
-          failed: 0
+          failed: 0,
         },
         runTime: {
-          history: expect.any(CircularBuffer)
+          history: expect.any(CircularBuffer),
         },
         waitTime: {
-          history: expect.any(CircularBuffer)
+          history: expect.any(CircularBuffer),
         },
         elu: expect.objectContaining({
           idle: expect.objectContaining({
-            history: expect.any(CircularBuffer)
+            history: expect.any(CircularBuffer),
           }),
           active: expect.objectContaining({
-            history: expect.any(CircularBuffer)
-          })
-        })
+            history: expect.any(CircularBuffer),
+          }),
+        }),
       })
       expect(workerNode.usage.tasks.executed).toBeGreaterThanOrEqual(0)
       expect(workerNode.usage.tasks.executed).toBeLessThanOrEqual(
@@ -1083,7 +1083,7 @@ describe('Selection strategies test suite', () => {
     )
     expect(pool.workerChoiceStrategiesContext.getPolicy()).toStrictEqual({
       dynamicWorkerUsage: false,
-      dynamicWorkerReady: true
+      dynamicWorkerReady: true,
     })
     await pool.destroy()
     pool = new DynamicThreadPool(
@@ -1094,7 +1094,7 @@ describe('Selection strategies test suite', () => {
     )
     expect(pool.workerChoiceStrategiesContext.getPolicy()).toStrictEqual({
       dynamicWorkerUsage: false,
-      dynamicWorkerReady: true
+      dynamicWorkerReady: true,
     })
     // We need to clean up the resources after our test
     await pool.destroy()
@@ -1113,18 +1113,18 @@ describe('Selection strategies test suite', () => {
       runTime: {
         aggregate: true,
         average: true,
-        median: false
+        median: false,
       },
       waitTime: {
         aggregate: true,
         average: true,
-        median: false
+        median: false,
       },
       elu: {
         aggregate: true,
         average: true,
-        median: false
-      }
+        median: false,
+      },
     })
     await pool.destroy()
     pool = new DynamicThreadPool(
@@ -1139,18 +1139,18 @@ describe('Selection strategies test suite', () => {
       runTime: {
         aggregate: true,
         average: true,
-        median: false
+        median: false,
       },
       waitTime: {
         aggregate: true,
         average: true,
-        median: false
+        median: false,
       },
       elu: {
         aggregate: true,
         average: true,
-        median: false
-      }
+        median: false,
+      },
     })
     // We need to clean up the resources after our test
     await pool.destroy()
@@ -1178,22 +1178,22 @@ describe('Selection strategies test suite', () => {
           maxQueued: 0,
           sequentiallyStolen: 0,
           stolen: 0,
-          failed: 0
+          failed: 0,
         },
         runTime: expect.objectContaining({
-          history: expect.any(CircularBuffer)
+          history: expect.any(CircularBuffer),
         }),
         waitTime: expect.objectContaining({
-          history: expect.any(CircularBuffer)
+          history: expect.any(CircularBuffer),
         }),
         elu: expect.objectContaining({
           idle: expect.objectContaining({
-            history: expect.any(CircularBuffer)
+            history: expect.any(CircularBuffer),
           }),
           active: expect.objectContaining({
-            history: expect.any(CircularBuffer)
-          })
-        })
+            history: expect.any(CircularBuffer),
+          }),
+        }),
       })
       expect(workerNode.usage.tasks.executed).toBeGreaterThanOrEqual(0)
       expect(workerNode.usage.tasks.executed).toBeLessThanOrEqual(
@@ -1274,22 +1274,22 @@ describe('Selection strategies test suite', () => {
           maxQueued: 0,
           sequentiallyStolen: 0,
           stolen: 0,
-          failed: 0
+          failed: 0,
         },
         runTime: expect.objectContaining({
-          history: expect.any(CircularBuffer)
+          history: expect.any(CircularBuffer),
         }),
         waitTime: expect.objectContaining({
-          history: expect.any(CircularBuffer)
+          history: expect.any(CircularBuffer),
         }),
         elu: expect.objectContaining({
           idle: expect.objectContaining({
-            history: expect.any(CircularBuffer)
+            history: expect.any(CircularBuffer),
           }),
           active: expect.objectContaining({
-            history: expect.any(CircularBuffer)
-          })
-        })
+            history: expect.any(CircularBuffer),
+          }),
+        }),
       })
       expect(workerNode.usage.tasks.executed).toBeGreaterThanOrEqual(0)
       expect(workerNode.usage.tasks.executed).toBeLessThanOrEqual(
@@ -1355,8 +1355,8 @@ describe('Selection strategies test suite', () => {
       {
         workerChoiceStrategy: WorkerChoiceStrategies.FAIR_SHARE,
         workerChoiceStrategyOptions: {
-          runTime: { median: true }
-        }
+          runTime: { median: true },
+        },
       }
     )
     // TODO: Create a better test to cover `FairShareChoiceStrategy#choose`
@@ -1375,22 +1375,22 @@ describe('Selection strategies test suite', () => {
           maxQueued: 0,
           sequentiallyStolen: 0,
           stolen: 0,
-          failed: 0
+          failed: 0,
         },
         runTime: expect.objectContaining({
-          history: expect.any(CircularBuffer)
+          history: expect.any(CircularBuffer),
         }),
         waitTime: expect.objectContaining({
-          history: expect.any(CircularBuffer)
+          history: expect.any(CircularBuffer),
         }),
         elu: expect.objectContaining({
           idle: expect.objectContaining({
-            history: expect.any(CircularBuffer)
+            history: expect.any(CircularBuffer),
           }),
           active: expect.objectContaining({
-            history: expect.any(CircularBuffer)
-          })
-        })
+            history: expect.any(CircularBuffer),
+          }),
+        }),
       })
       expect(workerNode.usage.tasks.executed).toBeGreaterThanOrEqual(0)
       expect(workerNode.usage.tasks.executed).toBeLessThanOrEqual(
@@ -1456,7 +1456,7 @@ describe('Selection strategies test suite', () => {
     )
     for (const workerNode of pool.workerNodes) {
       workerNode.strategyData = {
-        virtualTaskEndTimestamp: performance.now()
+        virtualTaskEndTimestamp: performance.now(),
       }
     }
     pool.setWorkerChoiceStrategy(workerChoiceStrategy)
@@ -1471,7 +1471,7 @@ describe('Selection strategies test suite', () => {
     )
     for (const workerNode of pool.workerNodes) {
       workerNode.strategyData = {
-        virtualTaskEndTimestamp: performance.now()
+        virtualTaskEndTimestamp: performance.now(),
       }
     }
     pool.setWorkerChoiceStrategy(workerChoiceStrategy)
@@ -1491,7 +1491,7 @@ describe('Selection strategies test suite', () => {
     )
     expect(pool.workerChoiceStrategiesContext.getPolicy()).toStrictEqual({
       dynamicWorkerUsage: false,
-      dynamicWorkerReady: true
+      dynamicWorkerReady: true,
     })
     await pool.destroy()
     pool = new DynamicThreadPool(
@@ -1502,7 +1502,7 @@ describe('Selection strategies test suite', () => {
     )
     expect(pool.workerChoiceStrategiesContext.getPolicy()).toStrictEqual({
       dynamicWorkerUsage: false,
-      dynamicWorkerReady: true
+      dynamicWorkerReady: true,
     })
     // We need to clean up the resources after our test
     await pool.destroy()
@@ -1521,18 +1521,18 @@ describe('Selection strategies test suite', () => {
       runTime: {
         aggregate: true,
         average: true,
-        median: false
+        median: false,
       },
       waitTime: {
         aggregate: true,
         average: true,
-        median: false
+        median: false,
       },
       elu: {
         aggregate: false,
         average: false,
-        median: false
-      }
+        median: false,
+      },
     })
     await pool.destroy()
     pool = new DynamicThreadPool(
@@ -1547,18 +1547,18 @@ describe('Selection strategies test suite', () => {
       runTime: {
         aggregate: true,
         average: true,
-        median: false
+        median: false,
       },
       waitTime: {
         aggregate: true,
         average: true,
-        median: false
+        median: false,
       },
       elu: {
         aggregate: false,
         average: false,
-        median: false
-      }
+        median: false,
+      },
     })
     // We need to clean up the resources after our test
     await pool.destroy()
@@ -1586,22 +1586,22 @@ describe('Selection strategies test suite', () => {
           maxQueued: 0,
           sequentiallyStolen: 0,
           stolen: 0,
-          failed: 0
+          failed: 0,
         },
         runTime: expect.objectContaining({
-          history: expect.any(CircularBuffer)
+          history: expect.any(CircularBuffer),
         }),
         waitTime: expect.objectContaining({
-          history: expect.any(CircularBuffer)
+          history: expect.any(CircularBuffer),
         }),
         elu: {
           idle: {
-            history: expect.any(CircularBuffer)
+            history: expect.any(CircularBuffer),
           },
           active: {
-            history: expect.any(CircularBuffer)
-          }
-        }
+            history: expect.any(CircularBuffer),
+          },
+        },
       })
       expect(workerNode.usage.tasks.executed).toBeGreaterThanOrEqual(0)
       expect(workerNode.usage.tasks.executed).toBeLessThanOrEqual(
@@ -1670,22 +1670,22 @@ describe('Selection strategies test suite', () => {
           maxQueued: 0,
           sequentiallyStolen: 0,
           stolen: 0,
-          failed: 0
+          failed: 0,
         },
         runTime: expect.objectContaining({
-          history: expect.any(CircularBuffer)
+          history: expect.any(CircularBuffer),
         }),
         waitTime: expect.objectContaining({
-          history: expect.any(CircularBuffer)
+          history: expect.any(CircularBuffer),
         }),
         elu: {
           idle: {
-            history: expect.any(CircularBuffer)
+            history: expect.any(CircularBuffer),
           },
           active: {
-            history: expect.any(CircularBuffer)
-          }
-        }
+            history: expect.any(CircularBuffer),
+          },
+        },
       })
       expect(workerNode.usage.tasks.executed).toBeGreaterThanOrEqual(0)
       expect(workerNode.usage.tasks.executed).toBeLessThanOrEqual(
@@ -1739,8 +1739,8 @@ describe('Selection strategies test suite', () => {
       {
         workerChoiceStrategy: WorkerChoiceStrategies.WEIGHTED_ROUND_ROBIN,
         workerChoiceStrategyOptions: {
-          runTime: { median: true }
-        }
+          runTime: { median: true },
+        },
       }
     )
     // TODO: Create a better test to cover `WeightedRoundRobinWorkerChoiceStrategy#choose`
@@ -1759,22 +1759,22 @@ describe('Selection strategies test suite', () => {
           maxQueued: 0,
           sequentiallyStolen: 0,
           stolen: 0,
-          failed: 0
+          failed: 0,
         },
         runTime: expect.objectContaining({
-          history: expect.any(CircularBuffer)
+          history: expect.any(CircularBuffer),
         }),
         waitTime: expect.objectContaining({
-          history: expect.any(CircularBuffer)
+          history: expect.any(CircularBuffer),
         }),
         elu: {
           idle: {
-            history: expect.any(CircularBuffer)
+            history: expect.any(CircularBuffer),
           },
           active: {
-            history: expect.any(CircularBuffer)
-          }
-        }
+            history: expect.any(CircularBuffer),
+          },
+        },
       })
       expect(workerNode.usage.tasks.executed).toBeGreaterThanOrEqual(0)
       expect(workerNode.usage.tasks.executed).toBeLessThanOrEqual(
@@ -1898,7 +1898,7 @@ describe('Selection strategies test suite', () => {
     )
     expect(pool.workerChoiceStrategiesContext.getPolicy()).toStrictEqual({
       dynamicWorkerUsage: false,
-      dynamicWorkerReady: true
+      dynamicWorkerReady: true,
     })
     await pool.destroy()
     pool = new DynamicThreadPool(
@@ -1909,7 +1909,7 @@ describe('Selection strategies test suite', () => {
     )
     expect(pool.workerChoiceStrategiesContext.getPolicy()).toStrictEqual({
       dynamicWorkerUsage: false,
-      dynamicWorkerReady: true
+      dynamicWorkerReady: true,
     })
     // We need to clean up the resources after our test
     await pool.destroy()
@@ -1929,18 +1929,18 @@ describe('Selection strategies test suite', () => {
       runTime: {
         aggregate: true,
         average: true,
-        median: false
+        median: false,
       },
       waitTime: {
         aggregate: true,
         average: true,
-        median: false
+        median: false,
       },
       elu: {
         aggregate: false,
         average: false,
-        median: false
-      }
+        median: false,
+      },
     })
     await pool.destroy()
     pool = new DynamicThreadPool(
@@ -1955,18 +1955,18 @@ describe('Selection strategies test suite', () => {
       runTime: {
         aggregate: true,
         average: true,
-        median: false
+        median: false,
       },
       waitTime: {
         aggregate: true,
         average: true,
-        median: false
+        median: false,
       },
       elu: {
         aggregate: false,
         average: false,
-        median: false
-      }
+        median: false,
+      },
     })
     // We need to clean up the resources after our test
     await pool.destroy()
@@ -1978,7 +1978,7 @@ describe('Selection strategies test suite', () => {
       './tests/worker-files/thread/testWorker.mjs',
       {
         workerChoiceStrategy:
-          WorkerChoiceStrategies.INTERLEAVED_WEIGHTED_ROUND_ROBIN
+          WorkerChoiceStrategies.INTERLEAVED_WEIGHTED_ROUND_ROBIN,
       }
     )
     // TODO: Create a better test to cover `InterleavedWeightedRoundRobinWorkerChoiceStrategy#choose`
@@ -1997,22 +1997,22 @@ describe('Selection strategies test suite', () => {
           maxQueued: 0,
           sequentiallyStolen: 0,
           stolen: 0,
-          failed: 0
+          failed: 0,
         },
         runTime: expect.objectContaining({
-          history: expect.any(CircularBuffer)
+          history: expect.any(CircularBuffer),
         }),
         waitTime: expect.objectContaining({
-          history: expect.any(CircularBuffer)
+          history: expect.any(CircularBuffer),
         }),
         elu: {
           idle: {
-            history: expect.any(CircularBuffer)
+            history: expect.any(CircularBuffer),
           },
           active: {
-            history: expect.any(CircularBuffer)
-          }
-        }
+            history: expect.any(CircularBuffer),
+          },
+        },
       })
       expect(workerNode.usage.tasks.executed).toBeGreaterThanOrEqual(0)
       expect(workerNode.usage.tasks.executed).toBeLessThanOrEqual(
@@ -2082,7 +2082,7 @@ describe('Selection strategies test suite', () => {
       './tests/worker-files/thread/testWorker.mjs',
       {
         workerChoiceStrategy:
-          WorkerChoiceStrategies.INTERLEAVED_WEIGHTED_ROUND_ROBIN
+          WorkerChoiceStrategies.INTERLEAVED_WEIGHTED_ROUND_ROBIN,
       }
     )
     // TODO: Create a better test to cover `InterleavedWeightedRoundRobinWorkerChoiceStrategy#choose`
@@ -2101,22 +2101,22 @@ describe('Selection strategies test suite', () => {
           maxQueued: 0,
           sequentiallyStolen: 0,
           stolen: 0,
-          failed: 0
+          failed: 0,
         },
         runTime: expect.objectContaining({
-          history: expect.any(CircularBuffer)
+          history: expect.any(CircularBuffer),
         }),
         waitTime: expect.objectContaining({
-          history: expect.any(CircularBuffer)
+          history: expect.any(CircularBuffer),
         }),
         elu: {
           idle: {
-            history: expect.any(CircularBuffer)
+            history: expect.any(CircularBuffer),
           },
           active: {
-            history: expect.any(CircularBuffer)
-          }
-        }
+            history: expect.any(CircularBuffer),
+          },
+        },
       })
       expect(workerNode.usage.tasks.executed).toBeGreaterThanOrEqual(0)
       expect(workerNode.usage.tasks.executed).toBeLessThanOrEqual(
index aeb7db1797e6bb1389181a9b9a586c05cc277c88..e046af55d5a8eeebada837a3971c2cdac55b7ea6 100644 (file)
@@ -4,7 +4,7 @@ import { createStubInstance, restore, stub } from 'sinon'
 import {
   DynamicThreadPool,
   FixedThreadPool,
-  WorkerChoiceStrategies
+  WorkerChoiceStrategies,
 } from '../../../lib/index.cjs'
 import { FairShareWorkerChoiceStrategy } from '../../../lib/pools/selection-strategies/fair-share-worker-choice-strategy.cjs'
 import { InterleavedWeightedRoundRobinWorkerChoiceStrategy } from '../../../lib/pools/selection-strategies/interleaved-weighted-round-robin-worker-choice-strategy.cjs'
@@ -87,7 +87,7 @@ describe('Worker choice strategies context test suite', () => {
     const workerChoiceStrategyUndefinedStub = createStubInstance(
       RoundRobinWorkerChoiceStrategy,
       {
-        choose: stub().returns(undefined)
+        choose: stub().returns(undefined),
       }
     )
     workerChoiceStrategiesContext.workerChoiceStrategies.set(
@@ -102,7 +102,7 @@ describe('Worker choice strategies context test suite', () => {
     const workerChoiceStrategyNullStub = createStubInstance(
       RoundRobinWorkerChoiceStrategy,
       {
-        choose: stub().returns(null)
+        choose: stub().returns(null),
       }
     )
     workerChoiceStrategiesContext.workerChoiceStrategies.set(
@@ -134,7 +134,7 @@ describe('Worker choice strategies context test suite', () => {
           .returns(undefined)
           .onCall(4)
           .returns(undefined)
-          .returns(1)
+          .returns(1),
       }
     )
     expect(workerChoiceStrategiesContext.defaultWorkerChoiceStrategy).toBe(
@@ -160,7 +160,7 @@ describe('Worker choice strategies context test suite', () => {
     const workerChoiceStrategyStub = createStubInstance(
       RoundRobinWorkerChoiceStrategy,
       {
-        choose: stub().returns(0)
+        choose: stub().returns(0),
       }
     )
     expect(workerChoiceStrategiesContext.defaultWorkerChoiceStrategy).toBe(
@@ -186,7 +186,7 @@ describe('Worker choice strategies context test suite', () => {
     const workerChoiceStrategyStub = createStubInstance(
       RoundRobinWorkerChoiceStrategy,
       {
-        choose: stub().returns(0)
+        choose: stub().returns(0),
       }
     )
     expect(workerChoiceStrategiesContext.defaultWorkerChoiceStrategy).toBe(
@@ -418,7 +418,7 @@ describe('Worker choice strategies context test suite', () => {
       [wwrWorkerChoiceStrategy],
       {
         runTime: { median: true },
-        waitTime: { median: true }
+        waitTime: { median: true },
       }
     )
     expect(
@@ -442,7 +442,7 @@ describe('Worker choice strategies context test suite', () => {
       [wwrWorkerChoiceStrategy],
       {
         runTime: { median: true },
-        waitTime: { median: true }
+        waitTime: { median: true },
       }
     )
     expect(
@@ -467,7 +467,7 @@ describe('Worker choice strategies context test suite', () => {
       [fsWorkerChoiceStrategy],
       {
         runTime: { median: true },
-        waitTime: { median: true }
+        waitTime: { median: true },
       }
     )
     expect(
@@ -491,7 +491,7 @@ describe('Worker choice strategies context test suite', () => {
       [fsWorkerChoiceStrategy],
       {
         runTime: { median: true },
-        waitTime: { median: true }
+        waitTime: { median: true },
       }
     )
     expect(
index 22d89223f337c0d7a714811fa3b37c09ecd6b861..97bfbbfcebc4b17862c242279912a65d0918ef04 100644 (file)
@@ -3,7 +3,7 @@ import { expect } from 'expect'
 import {
   DynamicThreadPool,
   PoolEvents,
-  WorkerChoiceStrategies
+  WorkerChoiceStrategies,
 } from '../../../lib/index.cjs'
 import { TaskFunctions } from '../../test-types.cjs'
 import { sleep, waitPoolEvents, waitWorkerEvents } from '../../test-utils.cjs'
@@ -16,17 +16,17 @@ describe('Dynamic thread pool test suite', () => {
     max,
     './tests/worker-files/thread/testWorker.mjs',
     {
-      errorHandler: e => console.error(e)
+      errorHandler: e => console.error(e),
     }
   )
 
   it('Verify that the function is executed in a worker thread', async () => {
     let result = await pool.execute({
-      function: TaskFunctions.fibonacci
+      function: TaskFunctions.fibonacci,
     })
     expect(result).toBe(354224848179262000000)
     result = await pool.execute({
-      function: TaskFunctions.factorial
+      function: TaskFunctions.factorial,
     })
     expect(result).toBe(9.33262154439441e157)
   })
@@ -67,14 +67,14 @@ describe('Dynamic thread pool test suite', () => {
     pool.emitter.on(PoolEvents.destroy, () => ++poolDestroy)
     expect(pool.emitter.eventNames()).toStrictEqual([
       PoolEvents.busy,
-      PoolEvents.destroy
+      PoolEvents.destroy,
     ])
     await pool.destroy()
     const numberOfExitEvents = await exitPromise
     expect(pool.started).toBe(false)
     expect(pool.emitter.eventNames()).toStrictEqual([
       PoolEvents.busy,
-      PoolEvents.destroy
+      PoolEvents.destroy,
     ])
     expect(pool.readyEventEmitted).toBe(false)
     expect(pool.workerNodes.length).toBe(0)
@@ -108,7 +108,7 @@ describe('Dynamic thread pool test suite', () => {
       {
         errorHandler: e => console.error(e),
         onlineHandler: () => console.info('long executing worker is online'),
-        exitHandler: () => console.info('long executing worker exited')
+        exitHandler: () => console.info('long executing worker exited'),
       }
     )
     expect(longRunningPool.workerNodes.length).toBe(min)
@@ -136,7 +136,7 @@ describe('Dynamic thread pool test suite', () => {
       {
         errorHandler: e => console.error(e),
         onlineHandler: () => console.info('long executing worker is online'),
-        exitHandler: () => console.info('long executing worker exited')
+        exitHandler: () => console.info('long executing worker exited'),
       }
     )
     expect(longRunningPool.workerNodes.length).toBe(min)
@@ -169,12 +169,13 @@ describe('Dynamic thread pool test suite', () => {
         max,
         './tests/worker-files/thread/testWorker.mjs',
         {
-          workerChoiceStrategy
+          workerChoiceStrategy,
         }
       )
       expect(pool.starting).toBe(false)
       expect(pool.readyEventEmitted).toBe(false)
       for (let run = 0; run < 2; run++) {
+        // eslint-disable-next-line @typescript-eslint/no-unused-expressions
         run % 2 !== 0 && pool.enableTasksQueue(true)
         const maxMultiplier = 4
         const promises = new Set()
index 3da05735588953cf6c0882a30aa86a231dd8b841..044eb8083df9a40c8a241c6c76e042bac5546f67 100644 (file)
@@ -12,7 +12,7 @@ describe('Fixed thread pool test suite', () => {
     numberOfThreads,
     './tests/worker-files/thread/testWorker.mjs',
     {
-      errorHandler: e => console.error(e)
+      errorHandler: e => console.error(e),
     }
   )
   const queuePool = new FixedThreadPool(
@@ -21,9 +21,9 @@ describe('Fixed thread pool test suite', () => {
     {
       enableTasksQueue: true,
       tasksQueueOptions: {
-        concurrency: tasksConcurrency
+        concurrency: tasksConcurrency,
       },
-      errorHandler: e => console.error(e)
+      errorHandler: e => console.error(e),
     }
   )
   const emptyPool = new FixedThreadPool(
@@ -39,14 +39,14 @@ describe('Fixed thread pool test suite', () => {
     numberOfThreads,
     './tests/worker-files/thread/errorWorker.mjs',
     {
-      errorHandler: e => console.error(e)
+      errorHandler: e => console.error(e),
     }
   )
   const asyncErrorPool = new FixedThreadPool(
     numberOfThreads,
     './tests/worker-files/thread/asyncErrorWorker.mjs',
     {
-      errorHandler: e => console.error(e)
+      errorHandler: e => console.error(e),
     }
   )
   const asyncPool = new FixedThreadPool(
@@ -66,11 +66,11 @@ describe('Fixed thread pool test suite', () => {
 
   it('Verify that the function is executed in a worker thread', async () => {
     let result = await pool.execute({
-      function: TaskFunctions.fibonacci
+      function: TaskFunctions.fibonacci,
     })
     expect(result).toBe(354224848179262000000)
     result = await pool.execute({
-      function: TaskFunctions.factorial
+      function: TaskFunctions.factorial,
     })
     expect(result).toBe(9.33262154439441e157)
   })
@@ -85,7 +85,7 @@ describe('Fixed thread pool test suite', () => {
       numberOfThreads,
       './tests/worker-files/thread/testWorker.mjs',
       {
-        errorHandler: e => console.error(e)
+        errorHandler: e => console.error(e),
       }
     )
     expect(pool.emitter.eventNames()).toStrictEqual([])
@@ -195,7 +195,7 @@ describe('Fixed thread pool test suite', () => {
     try {
       result = await pool.execute(undefined, undefined, [
         new ArrayBuffer(16),
-        new MessageChannel().port1
+        new MessageChannel().port1,
       ])
     } catch (e) {
       error = e
@@ -204,7 +204,7 @@ describe('Fixed thread pool test suite', () => {
     expect(error).toBeUndefined()
     try {
       result = await pool.execute(undefined, undefined, [
-        new SharedArrayBuffer(16)
+        new SharedArrayBuffer(16),
       ])
     } catch (e) {
       error = e
@@ -238,7 +238,7 @@ describe('Fixed thread pool test suite', () => {
     expect(taskError).toStrictEqual({
       name: DEFAULT_TASK_NAME,
       message: new Error('Error Message from ThreadWorker'),
-      data
+      data,
     })
     expect(
       errorPool.workerNodes.some(
@@ -255,7 +255,7 @@ describe('Fixed thread pool test suite', () => {
       taskError = e
     })
     expect(asyncErrorPool.emitter.eventNames()).toStrictEqual([
-      PoolEvents.taskError
+      PoolEvents.taskError,
     ])
     let inError
     try {
@@ -271,7 +271,7 @@ describe('Fixed thread pool test suite', () => {
     expect(taskError).toStrictEqual({
       name: DEFAULT_TASK_NAME,
       message: new Error('Error Message from ThreadWorker:async'),
-      data
+      data,
     })
     expect(
       asyncErrorPool.workerNodes.some(
@@ -296,14 +296,14 @@ describe('Fixed thread pool test suite', () => {
     pool.emitter.on(PoolEvents.destroy, () => ++poolDestroy)
     expect(pool.emitter.eventNames()).toStrictEqual([
       PoolEvents.busy,
-      PoolEvents.destroy
+      PoolEvents.destroy,
     ])
     await pool.destroy()
     const numberOfExitEvents = await exitPromise
     expect(pool.started).toBe(false)
     expect(pool.emitter.eventNames()).toStrictEqual([
       PoolEvents.busy,
-      PoolEvents.destroy
+      PoolEvents.destroy,
     ])
     expect(pool.readyEventEmitted).toBe(false)
     expect(pool.workerNodes.length).toBe(0)
@@ -319,12 +319,12 @@ describe('Fixed thread pool test suite', () => {
     pool = new FixedThreadPool(numberOfThreads, workerFilePath, {
       workerOptions: {
         env: { TEST: 'test' },
-        name: 'test'
-      }
+        name: 'test',
+      },
     })
     expect(pool.opts.workerOptions).toStrictEqual({
       env: { TEST: 'test' },
-      name: 'test'
+      name: 'test',
     })
     await pool.destroy()
   })
index f29515d516bf4fc8250083afda6795af6aa3ac0f..21ddaa777b151af60ffb4be74c46130fb4e6c3c7 100644 (file)
@@ -11,7 +11,7 @@ import {
   getDefaultTasksQueueOptions,
   getWorkerId,
   getWorkerType,
-  updateMeasurementStatistics
+  updateMeasurementStatistics,
 } from '../../lib/pools/utils.cjs'
 import { MeasurementHistorySize } from '../../lib/pools/worker.cjs'
 
@@ -20,7 +20,7 @@ describe('Pool utils test suite', () => {
     expect(DEFAULT_MEASUREMENT_STATISTICS_REQUIREMENTS).toStrictEqual({
       aggregate: false,
       average: false,
-      median: false
+      median: false,
     })
   })
 
@@ -31,13 +31,13 @@ describe('Pool utils test suite', () => {
       size: Math.pow(poolMaxSize, 2),
       taskStealing: true,
       tasksStealingOnBackPressure: false,
-      tasksFinishedTimeout: 2000
+      tasksFinishedTimeout: 2000,
     })
   })
 
   it('Verify updateMeasurementStatistics() behavior', () => {
     const measurementStatistics = {
-      history: new CircularBuffer(MeasurementHistorySize)
+      history: new CircularBuffer(MeasurementHistorySize),
     }
     updateMeasurementStatistics(
       measurementStatistics,
@@ -47,7 +47,7 @@ describe('Pool utils test suite', () => {
     expect(measurementStatistics).toMatchObject({
       aggregate: 0.01,
       maximum: 0.01,
-      minimum: 0.01
+      minimum: 0.01,
     })
     updateMeasurementStatistics(
       measurementStatistics,
@@ -57,7 +57,7 @@ describe('Pool utils test suite', () => {
     expect(measurementStatistics).toMatchObject({
       aggregate: 0.03,
       maximum: 0.02,
-      minimum: 0.01
+      minimum: 0.01,
     })
     updateMeasurementStatistics(
       measurementStatistics,
@@ -68,7 +68,7 @@ describe('Pool utils test suite', () => {
       aggregate: 0.031,
       maximum: 0.02,
       minimum: 0.001,
-      average: 0.0010000000474974513
+      average: 0.0010000000474974513,
     })
     updateMeasurementStatistics(
       measurementStatistics,
@@ -79,7 +79,7 @@ describe('Pool utils test suite', () => {
       aggregate: 0.034,
       maximum: 0.02,
       minimum: 0.001,
-      average: 0.0020000000367872417
+      average: 0.0020000000367872417,
     })
     updateMeasurementStatistics(
       measurementStatistics,
@@ -90,7 +90,7 @@ describe('Pool utils test suite', () => {
       aggregate: 0.04,
       maximum: 0.02,
       minimum: 0.001,
-      median: 0.003000000026077032
+      median: 0.003000000026077032,
     })
     updateMeasurementStatistics(
       measurementStatistics,
@@ -101,7 +101,7 @@ describe('Pool utils test suite', () => {
       aggregate: 0.05,
       maximum: 0.02,
       minimum: 0.001,
-      average: 0.004999999975552782
+      average: 0.004999999975552782,
     })
   })
 
index e47ba10326d82cce07c5737b2050b0711d21d729..f00b8061b2e085e26f6b742ae2059b5da612c0a5 100644 (file)
@@ -16,7 +16,7 @@ describe('Worker node test suite', () => {
     {
       tasksQueueBackPressureSize: 12,
       tasksQueueBucketSize: 6,
-      tasksQueuePriority: true
+      tasksQueuePriority: true,
     }
   )
   const clusterWorkerNode = new WorkerNode(
@@ -25,7 +25,7 @@ describe('Worker node test suite', () => {
     {
       tasksQueueBackPressureSize: 12,
       tasksQueueBucketSize: 6,
-      tasksQueuePriority: true
+      tasksQueuePriority: true,
     }
   )
 
@@ -133,7 +133,7 @@ describe('Worker node test suite', () => {
           WorkerTypes.thread,
           './tests/worker-files/thread/testWorker.mjs',
           {
-            tasksQueueBackPressureSize: 12
+            tasksQueueBackPressureSize: 12,
           }
         )
     ).toThrow(
@@ -148,7 +148,7 @@ describe('Worker node test suite', () => {
           './tests/worker-files/thread/testWorker.mjs',
           {
             tasksQueueBackPressureSize: 12,
-            tasksQueueBucketSize: 'invalidTasksQueueBucketSize'
+            tasksQueueBucketSize: 'invalidTasksQueueBucketSize',
           }
         )
     ).toThrow(
@@ -199,7 +199,7 @@ describe('Worker node test suite', () => {
           './tests/worker-files/thread/testWorker.mjs',
           {
             tasksQueueBackPressureSize: 12,
-            tasksQueueBucketSize: 6
+            tasksQueueBucketSize: 6,
           }
         )
     ).toThrow(
@@ -215,7 +215,7 @@ describe('Worker node test suite', () => {
           {
             tasksQueueBackPressureSize: 12,
             tasksQueueBucketSize: 6,
-            tasksQueuePriority: 'invalidTasksQueuePriority'
+            tasksQueuePriority: 'invalidTasksQueuePriority',
           }
         )
     ).toThrow(
@@ -231,7 +231,7 @@ describe('Worker node test suite', () => {
       dynamic: false,
       ready: false,
       stealing: false,
-      backPressure: false
+      backPressure: false,
     })
     expect(threadWorkerNode.usage).toStrictEqual({
       tasks: {
@@ -241,22 +241,22 @@ describe('Worker node test suite', () => {
         maxQueued: 0,
         sequentiallyStolen: 0,
         stolen: 0,
-        failed: 0
+        failed: 0,
       },
       runTime: {
-        history: expect.any(CircularBuffer)
+        history: expect.any(CircularBuffer),
       },
       waitTime: {
-        history: expect.any(CircularBuffer)
+        history: expect.any(CircularBuffer),
       },
       elu: {
         idle: {
-          history: expect.any(CircularBuffer)
+          history: expect.any(CircularBuffer),
         },
         active: {
-          history: expect.any(CircularBuffer)
-        }
-      }
+          history: expect.any(CircularBuffer),
+        },
+      },
     })
     expect(threadWorkerNode.messageChannel).toBeInstanceOf(MessageChannel)
     expect(threadWorkerNode.tasksQueueBackPressureSize).toBe(12)
@@ -278,7 +278,7 @@ describe('Worker node test suite', () => {
       dynamic: false,
       ready: false,
       stealing: false,
-      backPressure: false
+      backPressure: false,
     })
     expect(clusterWorkerNode.usage).toStrictEqual({
       tasks: {
@@ -288,22 +288,22 @@ describe('Worker node test suite', () => {
         maxQueued: 0,
         sequentiallyStolen: 0,
         stolen: 0,
-        failed: 0
+        failed: 0,
       },
       runTime: {
-        history: expect.any(CircularBuffer)
+        history: expect.any(CircularBuffer),
       },
       waitTime: {
-        history: expect.any(CircularBuffer)
+        history: expect.any(CircularBuffer),
       },
       elu: {
         idle: {
-          history: expect.any(CircularBuffer)
+          history: expect.any(CircularBuffer),
         },
         active: {
-          history: expect.any(CircularBuffer)
-        }
-      }
+          history: expect.any(CircularBuffer),
+        },
+      },
     })
     expect(clusterWorkerNode.messageChannel).toBeUndefined()
     expect(clusterWorkerNode.tasksQueueBackPressureSize).toBe(12)
@@ -328,7 +328,7 @@ describe('Worker node test suite', () => {
     )
     threadWorkerNode.info.taskFunctionsProperties = [
       { name: DEFAULT_TASK_NAME },
-      { name: 'fn1' }
+      { name: 'fn1' },
     ]
     expect(() =>
       threadWorkerNode.getTaskFunctionWorkerUsage('invalidTaskFunction')
@@ -340,7 +340,7 @@ describe('Worker node test suite', () => {
     threadWorkerNode.info.taskFunctionsProperties = [
       { name: DEFAULT_TASK_NAME },
       { name: 'fn1' },
-      { name: 'fn2' }
+      { name: 'fn2' },
     ]
     expect(
       threadWorkerNode.getTaskFunctionWorkerUsage(DEFAULT_TASK_NAME)
@@ -351,22 +351,22 @@ describe('Worker node test suite', () => {
         queued: 0,
         sequentiallyStolen: 0,
         stolen: 0,
-        failed: 0
+        failed: 0,
       },
       runTime: {
-        history: expect.any(CircularBuffer)
+        history: expect.any(CircularBuffer),
       },
       waitTime: {
-        history: expect.any(CircularBuffer)
+        history: expect.any(CircularBuffer),
       },
       elu: {
         idle: {
-          history: expect.any(CircularBuffer)
+          history: expect.any(CircularBuffer),
         },
         active: {
-          history: expect.any(CircularBuffer)
-        }
-      }
+          history: expect.any(CircularBuffer),
+        },
+      },
     })
     expect(threadWorkerNode.getTaskFunctionWorkerUsage('fn1')).toStrictEqual({
       tasks: {
@@ -375,22 +375,22 @@ describe('Worker node test suite', () => {
         queued: 0,
         sequentiallyStolen: 0,
         stolen: 0,
-        failed: 0
+        failed: 0,
       },
       runTime: {
-        history: expect.any(CircularBuffer)
+        history: expect.any(CircularBuffer),
       },
       waitTime: {
-        history: expect.any(CircularBuffer)
+        history: expect.any(CircularBuffer),
       },
       elu: {
         idle: {
-          history: expect.any(CircularBuffer)
+          history: expect.any(CircularBuffer),
         },
         active: {
-          history: expect.any(CircularBuffer)
-        }
-      }
+          history: expect.any(CircularBuffer),
+        },
+      },
     })
     expect(threadWorkerNode.getTaskFunctionWorkerUsage('fn2')).toStrictEqual({
       tasks: {
@@ -399,22 +399,22 @@ describe('Worker node test suite', () => {
         queued: 0,
         sequentiallyStolen: 0,
         stolen: 0,
-        failed: 0
+        failed: 0,
       },
       runTime: {
-        history: expect.any(CircularBuffer)
+        history: expect.any(CircularBuffer),
       },
       waitTime: {
-        history: expect.any(CircularBuffer)
+        history: expect.any(CircularBuffer),
       },
       elu: {
         idle: {
-          history: expect.any(CircularBuffer)
+          history: expect.any(CircularBuffer),
         },
         active: {
-          history: expect.any(CircularBuffer)
-        }
-      }
+          history: expect.any(CircularBuffer),
+        },
+      },
     })
     expect(threadWorkerNode.taskFunctionsUsage.size).toBe(2)
   })
@@ -423,7 +423,7 @@ describe('Worker node test suite', () => {
     expect(threadWorkerNode.info.taskFunctionsProperties).toStrictEqual([
       { name: DEFAULT_TASK_NAME },
       { name: 'fn1' },
-      { name: 'fn2' }
+      { name: 'fn2' },
     ])
     expect(threadWorkerNode.taskFunctionsUsage.size).toBe(2)
     expect(
index 5240efd2e6da1f956a5f1a7149036e29c6fa6be9..839b6057ba96bc99610f1641b7f2c94acb9ae7ba 100644 (file)
@@ -44,7 +44,7 @@ describe('Priority queue test suite', () => {
     expect(priorityQueue.maxSize).toBe(1)
     expect(rtSize).toBe(priorityQueue.size)
     expect(priorityQueue.head.nodeArray).toMatchObject([
-      { data: 1, priority: 0 }
+      { data: 1, priority: 0 },
     ])
     expect(priorityQueue.head.next).toBe(undefined)
     expect(priorityQueue.tail).toStrictEqual(priorityQueue.head)
@@ -55,7 +55,7 @@ describe('Priority queue test suite', () => {
     expect(rtSize).toBe(priorityQueue.size)
     expect(priorityQueue.head.nodeArray).toMatchObject([
       { data: 1, priority: 0 },
-      { data: 2, priority: 0 }
+      { data: 2, priority: 0 },
     ])
     expect(priorityQueue.head.next).toBe(undefined)
     expect(priorityQueue.tail).toStrictEqual(priorityQueue.head)
@@ -67,7 +67,7 @@ describe('Priority queue test suite', () => {
     expect(priorityQueue.head.nodeArray).toMatchObject([
       { data: 1, priority: 0 },
       { data: 2, priority: 0 },
-      { data: 3, priority: 0 }
+      { data: 3, priority: 0 },
     ])
     expect(priorityQueue.head.next).toBe(undefined)
     expect(priorityQueue.tail).toStrictEqual(priorityQueue.head)
@@ -80,7 +80,7 @@ describe('Priority queue test suite', () => {
       { data: 3, priority: -1 },
       { data: 1, priority: 0 },
       { data: 2, priority: 0 },
-      { data: 3, priority: 0 }
+      { data: 3, priority: 0 },
     ])
     expect(priorityQueue.head.next).toBe(undefined)
     expect(priorityQueue.tail).toStrictEqual(priorityQueue.head)
@@ -94,7 +94,7 @@ describe('Priority queue test suite', () => {
       { data: 1, priority: 0 },
       { data: 2, priority: 0 },
       { data: 3, priority: 0 },
-      { data: 1, priority: 1 }
+      { data: 1, priority: 1 },
     ])
     expect(priorityQueue.head.next).toBe(undefined)
     expect(priorityQueue.tail).toStrictEqual(priorityQueue.head)
@@ -108,7 +108,7 @@ describe('Priority queue test suite', () => {
     expect(priorityQueue.maxSize).toBe(1)
     expect(rtSize).toBe(priorityQueue.size)
     expect(priorityQueue.head.nodeArray).toMatchObject([
-      { data: 1, priority: 0 }
+      { data: 1, priority: 0 },
     ])
     expect(priorityQueue.head.next).toBe(undefined)
     expect(priorityQueue.tail).toStrictEqual(priorityQueue.head)
@@ -119,7 +119,7 @@ describe('Priority queue test suite', () => {
     expect(rtSize).toBe(priorityQueue.size)
     expect(priorityQueue.head.nodeArray).toMatchObject([
       { data: 1, priority: 0 },
-      { data: 2, priority: 0 }
+      { data: 2, priority: 0 },
     ])
     expect(priorityQueue.head.next).toBe(undefined)
     expect(priorityQueue.tail).toStrictEqual(priorityQueue.head)
@@ -129,12 +129,12 @@ describe('Priority queue test suite', () => {
     expect(priorityQueue.maxSize).toBe(3)
     expect(rtSize).toBe(priorityQueue.size)
     expect(priorityQueue.head.nodeArray).toMatchObject([
-      { data: 3, priority: 0 }
+      { data: 3, priority: 0 },
     ])
     expect(priorityQueue.head.next).toBe(undefined)
     expect(priorityQueue.tail.nodeArray).toMatchObject([
       { data: 1, priority: 0 },
-      { data: 2, priority: 0 }
+      { data: 2, priority: 0 },
     ])
     expect(priorityQueue.tail.next).toStrictEqual(priorityQueue.head)
     rtSize = priorityQueue.enqueue(3, -1)
@@ -144,12 +144,12 @@ describe('Priority queue test suite', () => {
     expect(rtSize).toBe(priorityQueue.size)
     expect(priorityQueue.head.nodeArray).toMatchObject([
       { data: 3, priority: -1 },
-      { data: 3, priority: 0 }
+      { data: 3, priority: 0 },
     ])
     expect(priorityQueue.head.next).toBe(undefined)
     expect(priorityQueue.tail.nodeArray).toMatchObject([
       { data: 1, priority: 0 },
-      { data: 2, priority: 0 }
+      { data: 2, priority: 0 },
     ])
     expect(priorityQueue.tail.next).toStrictEqual(priorityQueue.head)
     rtSize = priorityQueue.enqueue(1, 1)
@@ -158,17 +158,17 @@ describe('Priority queue test suite', () => {
     expect(priorityQueue.maxSize).toBe(5)
     expect(rtSize).toBe(priorityQueue.size)
     expect(priorityQueue.head.nodeArray).toMatchObject([
-      { data: 1, priority: 1 }
+      { data: 1, priority: 1 },
     ])
     expect(priorityQueue.head.next).toBe(undefined)
     expect(priorityQueue.tail.nodeArray).toMatchObject([
       { data: 1, priority: 0 },
-      { data: 2, priority: 0 }
+      { data: 2, priority: 0 },
     ])
     expect(priorityQueue.tail.next).not.toStrictEqual(priorityQueue.head)
     expect(priorityQueue.tail.next.nodeArray).toMatchObject([
       { data: 3, priority: -1 },
-      { data: 3, priority: 0 }
+      { data: 3, priority: 0 },
     ])
     rtSize = priorityQueue.enqueue(3, -2)
     expect(priorityQueue.buckets).toBe(3)
@@ -177,17 +177,17 @@ describe('Priority queue test suite', () => {
     expect(rtSize).toBe(priorityQueue.size)
     expect(priorityQueue.head.nodeArray).toMatchObject([
       { data: 3, priority: -2 },
-      { data: 1, priority: 1 }
+      { data: 1, priority: 1 },
     ])
     expect(priorityQueue.head.next).toBe(undefined)
     expect(priorityQueue.tail.nodeArray).toMatchObject([
       { data: 1, priority: 0 },
-      { data: 2, priority: 0 }
+      { data: 2, priority: 0 },
     ])
     expect(priorityQueue.tail.next).not.toStrictEqual(priorityQueue.head)
     expect(priorityQueue.tail.next.nodeArray).toMatchObject([
       { data: 3, priority: -1 },
-      { data: 3, priority: 0 }
+      { data: 3, priority: 0 },
     ])
   })
 
index 402aa305b54e163261a7dfc932aa9b0abf3ba5c1..707bb160efc40357561ecb54d5087abb7523a42b 100644 (file)
@@ -1,7 +1,7 @@
 const TaskFunctions = {
   jsonIntegerSerialization: 'jsonIntegerSerialization',
   fibonacci: 'fibonacci',
-  factorial: 'factorial'
+  factorial: 'factorial',
 }
 
 module.exports = { TaskFunctions }
index 4448eaf6a1b79539bc5b717c6f22704092d3102c..5006df6e876065a75c893676185404d3c4c60a11 100644 (file)
@@ -58,7 +58,7 @@ const sleepTaskFunction = async (
 const jsonIntegerSerialization = n => {
   for (let i = 0; i < n; i++) {
     const o = {
-      a: i
+      a: i,
     }
     JSON.stringify(o)
   }
@@ -66,8 +66,8 @@ const jsonIntegerSerialization = n => {
 }
 
 /**
- * @param {number} n - The number of fibonacci numbers to generate.
- * @returns {number} - The nth fibonacci number.
+ * @param n - The number of fibonacci numbers to generate.
+ * @returns - The nth fibonacci number.
  */
 const fibonacci = n => {
   let current = 1
@@ -81,8 +81,8 @@ const fibonacci = n => {
 }
 
 /**
- * @param {number} n - The number to calculate the factorial of.
- * @returns {number} - The factorial of n.
+ * @param n - The number to calculate the factorial of.
+ * @returns - The factorial of n.
  */
 const factorial = n => {
   if (n === 0 || n === 1) {
@@ -117,5 +117,5 @@ module.exports = {
   sleep,
   sleepTaskFunction,
   waitPoolEvents,
-  waitWorkerEvents
+  waitWorkerEvents,
 }
index 6e97797e35bfc4228e750c3ddf519b625667da77..b977e102330e52440c618fdadf65b8bef0f51972 100644 (file)
@@ -19,7 +19,7 @@ import {
   // once,
   round,
   secureRandom,
-  sleep
+  sleep,
 } from '../lib/utils.cjs'
 
 describe('Utils test suite', () => {
@@ -150,7 +150,7 @@ describe('Utils test suite', () => {
     expect(isAsyncFunction('')).toBe(false)
     expect(isAsyncFunction([])).toBe(false)
     expect(isAsyncFunction(new Date())).toBe(false)
-    // eslint-disable-next-line prefer-regex-literals
+
     expect(isAsyncFunction(/[a-z]/i)).toBe(false)
     expect(isAsyncFunction(new Error())).toBe(false)
     expect(isAsyncFunction(new Map())).toBe(false)
index 022b4536ce1d18ae21eae0c2f245a3681371d2f0..06797611c71dc83448f4f32a7e03877518f01e85 100644 (file)
@@ -2,6 +2,10 @@
 const { ClusterWorker, KillBehaviors } = require('../../../lib/index.cjs')
 const { sleepTaskFunction } = require('../../test-utils.cjs')
 
+/**
+ *
+ * @param data
+ */
 async function error (data) {
   return sleepTaskFunction(
     data,
@@ -13,5 +17,5 @@ async function error (data) {
 
 module.exports = new ClusterWorker(error, {
   killBehavior: KillBehaviors.HARD,
-  maxInactiveTime: 500
+  maxInactiveTime: 500,
 })
index d680689138d23c8bd2d1312abc6d67192889bad4..12897f7ddbd7cde5ea7cd891f1e2e9ca00d7d95a 100644 (file)
@@ -2,11 +2,15 @@
 const { ClusterWorker, KillBehaviors } = require('../../../lib/index.cjs')
 const { sleepTaskFunction } = require('../../test-utils.cjs')
 
+/**
+ *
+ * @param data
+ */
 async function sleep (data) {
   return sleepTaskFunction(data, 2000)
 }
 
 module.exports = new ClusterWorker(sleep, {
   killBehavior: KillBehaviors.HARD,
-  maxInactiveTime: 500
+  maxInactiveTime: 500,
 })
index 4534d985b976c2d01d22c0cbd5d82b466a449dab..5052e18c86d997bdbfa34f3d963f7dc9635961cf 100644 (file)
@@ -1,10 +1,14 @@
 'use strict'
 const { ClusterWorker, KillBehaviors } = require('../../../lib/index.cjs')
 
+/**
+ *
+ * @param data
+ */
 function echo (data) {
   return data
 }
 
 module.exports = new ClusterWorker(echo, {
-  killBehavior: KillBehaviors.HARD
+  killBehavior: KillBehaviors.HARD,
 })
index 9c6072af255284a9ff1debe20fb77a0d49804c13..78f534ab8a2883e8e56a45bd7cd59280df31a36e 100644 (file)
@@ -1,9 +1,12 @@
 'use strict'
 const { ClusterWorker, KillBehaviors } = require('../../../lib/index.cjs')
 
+/**
+ *
+ */
 function test () {}
 
 module.exports = new ClusterWorker(test, {
   killBehavior: KillBehaviors.HARD,
-  maxInactiveTime: 500
+  maxInactiveTime: 500,
 })
index 2dcfe6252fea9f973e99e81c78d785887e9b8799..9a2695b258515ca364867f0a169f877108b0e905 100644 (file)
@@ -1,11 +1,14 @@
 'use strict'
 const { ClusterWorker, KillBehaviors } = require('../../../lib/index.cjs')
 
+/**
+ *
+ */
 function error () {
   throw new Error('Error Message from ClusterWorker')
 }
 
 module.exports = new ClusterWorker(error, {
   killBehavior: KillBehaviors.HARD,
-  maxInactiveTime: 500
+  maxInactiveTime: 500,
 })
index 2d7de52ed7016601a48cf224a42449bee01c5044..2dfaaafb56123e8fe36fdd79eb245228d7c9dfc1 100644 (file)
@@ -2,11 +2,15 @@
 const { ClusterWorker, KillBehaviors } = require('../../../lib/index.cjs')
 const { sleepTaskFunction } = require('../../test-utils.cjs')
 
+/**
+ *
+ * @param data
+ */
 async function sleep (data) {
   return sleepTaskFunction(data, 50000)
 }
 
 module.exports = new ClusterWorker(sleep, {
   killBehavior: KillBehaviors.HARD,
-  maxInactiveTime: 500
+  maxInactiveTime: 500,
 })
index 91eb2b3523c0986410685dfdd0bec2b52dd90fff..4a5bf10fee5c01c91ca3b23b94e322b38d007093 100644 (file)
@@ -2,10 +2,14 @@
 const { ClusterWorker } = require('../../../lib/index.cjs')
 const { sleepTaskFunction } = require('../../test-utils.cjs')
 
+/**
+ *
+ * @param data
+ */
 async function sleep (data) {
   return sleepTaskFunction(data, 50000)
 }
 
 module.exports = new ClusterWorker(sleep, {
-  maxInactiveTime: 500
+  maxInactiveTime: 500,
 })
index ef785aa1da49d098d72340230e90c4f2c5d9db03..0f8286a53381938a0a3fbf06e336720b8b7bb5c3 100644 (file)
@@ -3,17 +3,17 @@ const { ClusterWorker, KillBehaviors } = require('../../../lib/index.cjs')
 const {
   jsonIntegerSerialization,
   factorial,
-  fibonacci
+  fibonacci,
 } = require('../../test-utils.cjs')
 
 module.exports = new ClusterWorker(
   {
     jsonIntegerSerialization: data => jsonIntegerSerialization(data.n),
     factorial: data => factorial(data.n),
-    fibonacci: data => fibonacci(data.n)
+    fibonacci: data => fibonacci(data.n),
   },
   {
     killBehavior: KillBehaviors.HARD,
-    maxInactiveTime: 500
+    maxInactiveTime: 500,
   }
 )
index fcb6f18aa8086e0123862f6fc7795e76af2d21b6..9f4f4b4f4843573e53b992d3838728f5ba0fb0aa 100644 (file)
@@ -3,19 +3,19 @@ const { KillBehaviors, ClusterWorker } = require('../../../lib/index.cjs')
 const {
   factorial,
   fibonacci,
-  jsonIntegerSerialization
+  jsonIntegerSerialization,
 } = require('../../test-utils.cjs')
 
 module.exports = new ClusterWorker(
   {
     jsonIntegerSerialization: {
-      taskFunction: data => jsonIntegerSerialization(data.n)
+      taskFunction: data => jsonIntegerSerialization(data.n),
     },
     factorial: { taskFunction: data => factorial(data.n) },
-    fibonacci: { taskFunction: data => fibonacci(data.n), priority: -5 }
+    fibonacci: { taskFunction: data => fibonacci(data.n), priority: -5 },
   },
   {
     killBehavior: KillBehaviors.HARD,
-    maxInactiveTime: 500
+    maxInactiveTime: 500,
   }
 )
index fd6b2eb235514a5a05ec66064f718ad781e419d7..418afd7c05040df5eaec7dc453e22467846ece01 100644 (file)
@@ -3,6 +3,10 @@ const { ClusterWorker, KillBehaviors } = require('../../../lib/index.cjs')
 const { executeTaskFunction } = require('../../test-utils.cjs')
 const { TaskFunctions } = require('../../test-types.cjs')
 
+/**
+ *
+ * @param data
+ */
 function test (data) {
   data = data || {}
   data.function = data.function || TaskFunctions.jsonIntegerSerialization
@@ -11,5 +15,5 @@ function test (data) {
 
 module.exports = new ClusterWorker(test, {
   killBehavior: KillBehaviors.HARD,
-  maxInactiveTime: 500
+  maxInactiveTime: 500,
 })
index 9624b6d8e6fee51d20026af9f98f9a43dd472c4e..c6fa8910f3b549d005d4356ae6b15d361d8ed094 100644 (file)
@@ -17,5 +17,5 @@ async function error (data) {
 
 export default new ThreadWorker(error, {
   killBehavior: KillBehaviors.HARD,
-  maxInactiveTime: 500
+  maxInactiveTime: 500,
 })
index 623d517d171a8f1fcf83b999182f60e803a52a97..63db364ad1e1cc8129a701f55a5389ae1aea2c2a 100644 (file)
@@ -12,5 +12,5 @@ async function sleep (data) {
 
 export default new ThreadWorker(sleep, {
   killBehavior: KillBehaviors.HARD,
-  maxInactiveTime: 500
+  maxInactiveTime: 500,
 })
index 9a8ae66eb689ad731101e7bcc40f980d268a4210..e1ac41eebc419140ea97f53cc8e5a191900b638e 100644 (file)
@@ -10,5 +10,5 @@ function echo (data) {
 }
 
 export default new ThreadWorker(echo, {
-  killBehavior: KillBehaviors.HARD
+  killBehavior: KillBehaviors.HARD,
 })
index ad4d52bc1932b4f90dbb7947785d350863b2d7e8..7d37eb95e9f012cf7237902b51300fb8f7ac0113 100644 (file)
@@ -7,5 +7,5 @@ function test () {}
 
 export default new ThreadWorker(test, {
   killBehavior: KillBehaviors.HARD,
-  maxInactiveTime: 500
+  maxInactiveTime: 500,
 })
index ec86674371bcf16d7b605bbe9bfd86d9152f1eff..582d094ea39a8e7b9cea8286d4c51327da19e898 100644 (file)
@@ -9,5 +9,5 @@ function error () {
 
 export default new ThreadWorker(error, {
   killBehavior: KillBehaviors.HARD,
-  maxInactiveTime: 500
+  maxInactiveTime: 500,
 })
index 3d58ab456caf19e18e7decb58e115f1f1cf8acc1..1762947a8d4fa2cf61d6d89eb0afe5c40459b6c0 100644 (file)
@@ -12,5 +12,5 @@ async function sleep (data) {
 
 export default new ThreadWorker(sleep, {
   killBehavior: KillBehaviors.HARD,
-  maxInactiveTime: 500
+  maxInactiveTime: 500,
 })
index 4b7c15004d72b9e0a18d3e256d789e76156e0974..ae98f767e74930f161ffedadffb99e2da8219930 100644 (file)
@@ -11,5 +11,5 @@ async function sleep (data) {
 }
 
 export default new ThreadWorker(sleep, {
-  maxInactiveTime: 500
+  maxInactiveTime: 500,
 })
index 94e548ef1464916d9c8ffd91b3685caeb34cf984..7928ab02aa4e4b436a8a83cef1e4a4ac8b1287eb 100644 (file)
@@ -2,17 +2,17 @@ import { KillBehaviors, ThreadWorker } from '../../../lib/index.cjs'
 import {
   factorial,
   fibonacci,
-  jsonIntegerSerialization
+  jsonIntegerSerialization,
 } from '../../test-utils.cjs'
 
 export default new ThreadWorker(
   {
     jsonIntegerSerialization: data => jsonIntegerSerialization(data.n),
     factorial: data => factorial(data.n),
-    fibonacci: data => fibonacci(data.n)
+    fibonacci: data => fibonacci(data.n),
   },
   {
     killBehavior: KillBehaviors.HARD,
-    maxInactiveTime: 500
+    maxInactiveTime: 500,
   }
 )
index 45f4f9f2eae43037f7516afa1921d4581e9dfe0f..35cd6dafa570569713e20e9a487210d0e77a6906 100644 (file)
@@ -2,19 +2,19 @@ import { KillBehaviors, ThreadWorker } from '../../../lib/index.cjs'
 import {
   factorial,
   fibonacci,
-  jsonIntegerSerialization
+  jsonIntegerSerialization,
 } from '../../test-utils.cjs'
 
 export default new ThreadWorker(
   {
     jsonIntegerSerialization: {
-      taskFunction: data => jsonIntegerSerialization(data.n)
+      taskFunction: data => jsonIntegerSerialization(data.n),
     },
     factorial: { taskFunction: data => factorial(data.n) },
-    fibonacci: { taskFunction: data => fibonacci(data.n), priority: -5 }
+    fibonacci: { taskFunction: data => fibonacci(data.n), priority: -5 },
   },
   {
     killBehavior: KillBehaviors.HARD,
-    maxInactiveTime: 500
+    maxInactiveTime: 500,
   }
 )
index f4840e53b2aebb30c7b852d5cb349dcd4f615671..67959837807c1e89aa5f7ac27b112cdb9832b318 100644 (file)
@@ -15,5 +15,5 @@ function test (data) {
 
 export default new ThreadWorker(test, {
   killBehavior: KillBehaviors.HARD,
-  maxInactiveTime: 500
+  maxInactiveTime: 500,
 })
index 79f85cdb2030b6872c14ab74ae048d4b994707cd..ed4fcbdb2f887068d53212b6e7e3b2e36aed5111 100644 (file)
@@ -5,7 +5,7 @@ import {
   ClusterWorker,
   KillBehaviors,
   ThreadWorker,
-  WorkerChoiceStrategies
+  WorkerChoiceStrategies,
 } from '../../lib/index.cjs'
 import { DEFAULT_TASK_NAME, EMPTY_FUNCTION } from '../../lib/utils.cjs'
 
@@ -26,7 +26,7 @@ describe('Abstract worker test suite', () => {
     expect(worker.opts).toStrictEqual({
       killBehavior: KillBehaviors.SOFT,
       maxInactiveTime: 60000,
-      killHandler: EMPTY_FUNCTION
+      killHandler: EMPTY_FUNCTION,
     })
   })
 
@@ -71,12 +71,12 @@ describe('Abstract worker test suite', () => {
     const worker = new ClusterWorker(() => {}, {
       killBehavior: KillBehaviors.HARD,
       maxInactiveTime: 6000,
-      killHandler
+      killHandler,
     })
     expect(worker.opts).toStrictEqual({
       killBehavior: KillBehaviors.HARD,
       maxInactiveTime: 6000,
-      killHandler
+      killHandler,
     })
   })
 
@@ -138,10 +138,10 @@ describe('Abstract worker test suite', () => {
   it('Verify that taskFunctions parameter with unique function is taken', () => {
     const worker = new ThreadWorker(() => {})
     expect(worker.taskFunctions.get(DEFAULT_TASK_NAME)).toStrictEqual({
-      taskFunction: expect.any(Function)
+      taskFunction: expect.any(Function),
     })
     expect(worker.taskFunctions.get('fn1')).toStrictEqual({
-      taskFunction: expect.any(Function)
+      taskFunction: expect.any(Function),
     })
     expect(worker.taskFunctions.size).toBe(2)
     expect(worker.taskFunctions.get(DEFAULT_TASK_NAME)).toStrictEqual(
@@ -184,7 +184,7 @@ describe('Abstract worker test suite', () => {
     expect(
       () =>
         new ThreadWorker({
-          fn1: { taskFunction: fn1, strategy: 'invalidStrategy' }
+          fn1: { taskFunction: fn1, strategy: 'invalidStrategy' },
         })
     ).toThrow(new Error("Invalid worker choice strategy 'invalidStrategy'"))
   })
@@ -198,13 +198,13 @@ describe('Abstract worker test suite', () => {
     }
     const worker = new ClusterWorker({ fn1, fn2 })
     expect(worker.taskFunctions.get(DEFAULT_TASK_NAME)).toStrictEqual({
-      taskFunction: expect.any(Function)
+      taskFunction: expect.any(Function),
     })
     expect(worker.taskFunctions.get('fn1')).toStrictEqual({
-      taskFunction: expect.any(Function)
+      taskFunction: expect.any(Function),
     })
     expect(worker.taskFunctions.get('fn2')).toStrictEqual({
-      taskFunction: expect.any(Function)
+      taskFunction: expect.any(Function),
     })
     expect(worker.taskFunctions.size).toBe(3)
     expect(worker.taskFunctions.get(DEFAULT_TASK_NAME)).toStrictEqual(
@@ -217,18 +217,18 @@ describe('Abstract worker test suite', () => {
       taskFunction: () => {
         return 1
       },
-      priority: 5
+      priority: 5,
     }
     const fn2Obj = {
       taskFunction: () => {
         return 2
       },
       priority: 6,
-      strategy: WorkerChoiceStrategies.LESS_BUSY
+      strategy: WorkerChoiceStrategies.LESS_BUSY,
     }
     const worker = new ThreadWorker({
       fn1: fn1Obj,
-      fn2: fn2Obj
+      fn2: fn2Obj,
     })
     expect(worker.taskFunctions.get(DEFAULT_TASK_NAME)).toStrictEqual(fn1Obj)
     expect(worker.taskFunctions.get('fn1')).toStrictEqual(fn1Obj)
@@ -242,7 +242,7 @@ describe('Abstract worker test suite', () => {
   it('Verify that async kill handler is called when worker is killed', () => {
     const killHandlerStub = stub().returns()
     const worker = new ClusterWorker(() => {}, {
-      killHandler: async () => await Promise.resolve(killHandlerStub())
+      killHandler: async () => await Promise.resolve(killHandlerStub()),
     })
     worker.isMain = false
     worker.handleKillMessage()
@@ -265,14 +265,14 @@ describe('Abstract worker test suite', () => {
     const worker = new ClusterWorker({ fn1, fn2 })
     expect(worker.hasTaskFunction(0)).toStrictEqual({
       status: false,
-      error: new TypeError('name parameter is not a string')
+      error: new TypeError('name parameter is not a string'),
     })
     expect(worker.hasTaskFunction('')).toStrictEqual({
       status: false,
-      error: new TypeError('name parameter is an empty string')
+      error: new TypeError('name parameter is an empty string'),
     })
     expect(worker.hasTaskFunction(DEFAULT_TASK_NAME)).toStrictEqual({
-      status: true
+      status: true,
     })
     expect(worker.hasTaskFunction('fn1')).toStrictEqual({ status: true })
     expect(worker.hasTaskFunction('fn2')).toStrictEqual({ status: true })
@@ -292,62 +292,62 @@ describe('Abstract worker test suite', () => {
     const worker = new ThreadWorker(fn1)
     expect(worker.addTaskFunction(0, fn1)).toStrictEqual({
       status: false,
-      error: new TypeError('name parameter is not a string')
+      error: new TypeError('name parameter is not a string'),
     })
     expect(worker.addTaskFunction('', fn1)).toStrictEqual({
       status: false,
-      error: new TypeError('name parameter is an empty string')
+      error: new TypeError('name parameter is an empty string'),
     })
     expect(worker.addTaskFunction('fn2', 0)).toStrictEqual({
       status: false,
       error: new TypeError(
         "taskFunction object 'taskFunction' property 'undefined' is not a function"
-      )
+      ),
     })
     expect(worker.addTaskFunction('fn3', '')).toStrictEqual({
       status: false,
       error: new TypeError(
         "taskFunction object 'taskFunction' property 'undefined' is not a function"
-      )
+      ),
     })
     expect(worker.addTaskFunction('fn2', { taskFunction: 0 })).toStrictEqual({
       status: false,
       error: new TypeError(
         "taskFunction object 'taskFunction' property '0' is not a function"
-      )
+      ),
     })
     expect(worker.addTaskFunction('fn3', { taskFunction: '' })).toStrictEqual({
       status: false,
       error: new TypeError(
         "taskFunction object 'taskFunction' property '' is not a function"
-      )
+      ),
     })
     expect(
       worker.addTaskFunction('fn2', { taskFunction: () => {}, priority: -21 })
     ).toStrictEqual({
       status: false,
-      error: new RangeError("Property 'priority' must be between -20 and 19")
+      error: new RangeError("Property 'priority' must be between -20 and 19"),
     })
     expect(
       worker.addTaskFunction('fn3', { taskFunction: () => {}, priority: 20 })
     ).toStrictEqual({
       status: false,
-      error: new RangeError("Property 'priority' must be between -20 and 19")
+      error: new RangeError("Property 'priority' must be between -20 and 19"),
     })
     expect(
       worker.addTaskFunction('fn2', {
         taskFunction: () => {},
-        strategy: 'invalidStrategy'
+        strategy: 'invalidStrategy',
       })
     ).toStrictEqual({
       status: false,
-      error: new Error("Invalid worker choice strategy 'invalidStrategy'")
+      error: new Error("Invalid worker choice strategy 'invalidStrategy'"),
     })
     expect(worker.taskFunctions.get(DEFAULT_TASK_NAME)).toStrictEqual({
-      taskFunction: expect.any(Function)
+      taskFunction: expect.any(Function),
     })
     expect(worker.taskFunctions.get('fn1')).toStrictEqual({
-      taskFunction: expect.any(Function)
+      taskFunction: expect.any(Function),
     })
     expect(worker.taskFunctions.size).toBe(2)
     expect(worker.taskFunctions.get(DEFAULT_TASK_NAME)).toStrictEqual(
@@ -357,17 +357,17 @@ describe('Abstract worker test suite', () => {
       status: false,
       error: new Error(
         'Cannot add a task function with the default reserved name'
-      )
+      ),
     })
     worker.addTaskFunction('fn2', fn2)
     expect(worker.taskFunctions.get(DEFAULT_TASK_NAME)).toStrictEqual({
-      taskFunction: expect.any(Function)
+      taskFunction: expect.any(Function),
     })
     expect(worker.taskFunctions.get('fn1')).toStrictEqual({
-      taskFunction: expect.any(Function)
+      taskFunction: expect.any(Function),
     })
     expect(worker.taskFunctions.get('fn2')).toStrictEqual({
-      taskFunction: expect.any(Function)
+      taskFunction: expect.any(Function),
     })
     expect(worker.taskFunctions.size).toBe(3)
     expect(worker.taskFunctions.get(DEFAULT_TASK_NAME)).toStrictEqual(
@@ -375,13 +375,13 @@ describe('Abstract worker test suite', () => {
     )
     worker.addTaskFunction('fn1', fn1Replacement)
     expect(worker.taskFunctions.get(DEFAULT_TASK_NAME)).toStrictEqual({
-      taskFunction: expect.any(Function)
+      taskFunction: expect.any(Function),
     })
     expect(worker.taskFunctions.get('fn1')).toStrictEqual({
-      taskFunction: expect.any(Function)
+      taskFunction: expect.any(Function),
     })
     expect(worker.taskFunctions.get('fn2')).toStrictEqual({
-      taskFunction: expect.any(Function)
+      taskFunction: expect.any(Function),
     })
     expect(worker.taskFunctions.size).toBe(3)
     expect(worker.taskFunctions.get(DEFAULT_TASK_NAME)).toStrictEqual(
@@ -400,7 +400,7 @@ describe('Abstract worker test suite', () => {
     expect(worker.listTaskFunctionsProperties()).toStrictEqual([
       { name: DEFAULT_TASK_NAME },
       { name: 'fn1' },
-      { name: 'fn2' }
+      { name: 'fn2' },
     ])
   })
 
@@ -414,20 +414,20 @@ describe('Abstract worker test suite', () => {
     const worker = new ThreadWorker({ fn1, fn2 })
     expect(worker.setDefaultTaskFunction(0, fn1)).toStrictEqual({
       status: false,
-      error: new TypeError('name parameter is not a string')
+      error: new TypeError('name parameter is not a string'),
     })
     expect(worker.setDefaultTaskFunction('', fn1)).toStrictEqual({
       status: false,
-      error: new TypeError('name parameter is an empty string')
+      error: new TypeError('name parameter is an empty string'),
     })
     expect(worker.taskFunctions.get(DEFAULT_TASK_NAME)).toStrictEqual({
-      taskFunction: expect.any(Function)
+      taskFunction: expect.any(Function),
     })
     expect(worker.taskFunctions.get('fn1')).toStrictEqual({
-      taskFunction: expect.any(Function)
+      taskFunction: expect.any(Function),
     })
     expect(worker.taskFunctions.get('fn2')).toStrictEqual({
-      taskFunction: expect.any(Function)
+      taskFunction: expect.any(Function),
     })
     expect(worker.taskFunctions.size).toBe(3)
     expect(worker.taskFunctions.get(DEFAULT_TASK_NAME)).toStrictEqual(
@@ -437,13 +437,13 @@ describe('Abstract worker test suite', () => {
       status: false,
       error: new Error(
         'Cannot set the default task function reserved name as the default task function'
-      )
+      ),
     })
     expect(worker.setDefaultTaskFunction('fn3')).toStrictEqual({
       status: false,
       error: new Error(
         'Cannot set the default task function to a non-existing task function'
-      )
+      ),
     })
     worker.setDefaultTaskFunction('fn1')
     expect(worker.taskFunctions.get(DEFAULT_TASK_NAME)).toStrictEqual(
index 70d63639dab40d0a61622f73a8e5da18809c7ec7..2ad7911380c9844a12157e0c50f1232f9e991a27 100644 (file)
@@ -19,12 +19,12 @@ describe('Cluster worker test suite', () => {
 
   it('Verify that sync kill handler is called when worker is killed', () => {
     const worker = new ClusterWorker(() => {}, {
-      killHandler: stub().returns()
+      killHandler: stub().returns(),
     })
     worker.isMain = false
     worker.getMainWorker = stub().returns({
       id: 1,
-      send: stub().returns()
+      send: stub().returns(),
     })
     worker.handleKillMessage()
     expect(worker.getMainWorker.calledTwice).toBe(true)
@@ -42,24 +42,24 @@ describe('Cluster worker test suite', () => {
     const worker = new ClusterWorker({ fn1, fn2 })
     worker.getMainWorker = stub().returns({
       id: 1,
-      send: stub().returns()
+      send: stub().returns(),
     })
     expect(worker.removeTaskFunction(0, fn1)).toStrictEqual({
       status: false,
-      error: new TypeError('name parameter is not a string')
+      error: new TypeError('name parameter is not a string'),
     })
     expect(worker.removeTaskFunction('', fn1)).toStrictEqual({
       status: false,
-      error: new TypeError('name parameter is an empty string')
+      error: new TypeError('name parameter is an empty string'),
     })
     expect(worker.taskFunctions.get(DEFAULT_TASK_NAME)).toStrictEqual({
-      taskFunction: expect.any(Function)
+      taskFunction: expect.any(Function),
     })
     expect(worker.taskFunctions.get('fn1')).toStrictEqual({
-      taskFunction: expect.any(Function)
+      taskFunction: expect.any(Function),
     })
     expect(worker.taskFunctions.get('fn2')).toStrictEqual({
-      taskFunction: expect.any(Function)
+      taskFunction: expect.any(Function),
     })
     expect(worker.taskFunctions.size).toBe(3)
     expect(worker.taskFunctions.get(DEFAULT_TASK_NAME)).toStrictEqual(
@@ -69,20 +69,20 @@ describe('Cluster worker test suite', () => {
       status: false,
       error: new Error(
         'Cannot remove the task function with the default reserved name'
-      )
+      ),
     })
     expect(worker.removeTaskFunction('fn1')).toStrictEqual({
       status: false,
       error: new Error(
         'Cannot remove the task function used as the default task function'
-      )
+      ),
     })
     worker.removeTaskFunction('fn2')
     expect(worker.taskFunctions.get(DEFAULT_TASK_NAME)).toStrictEqual({
-      taskFunction: expect.any(Function)
+      taskFunction: expect.any(Function),
     })
     expect(worker.taskFunctions.get('fn1')).toStrictEqual({
-      taskFunction: expect.any(Function)
+      taskFunction: expect.any(Function),
     })
     expect(worker.taskFunctions.get('fn2')).toBeUndefined()
     expect(worker.taskFunctions.size).toBe(2)
@@ -102,7 +102,7 @@ describe('Cluster worker test suite', () => {
   it('Verify that sendToMainWorker() method invokes the getMainWorker() and send() methods', () => {
     const worker = new ClusterWorker(() => {})
     worker.getMainWorker = stub().returns({
-      send: stub().returns()
+      send: stub().returns(),
     })
     worker.sendToMainWorker({ ok: 1 })
     expect(worker.getMainWorker.calledTwice).toBe(true)
index 3151b90a4a04d367e262f9f3cee8bf8569bc25c4..f78451f7d95482a33660076d71408c073661fc66 100644 (file)
@@ -19,13 +19,13 @@ describe('Thread worker test suite', () => {
 
   it('Verify that sync kill handler is called when worker is killed', () => {
     const worker = new ThreadWorker(() => {}, {
-      killHandler: stub().returns()
+      killHandler: stub().returns(),
     })
     worker.isMain = false
     worker.port = {
       postMessage: stub().returns(),
       unref: stub().returns(),
-      close: stub().returns()
+      close: stub().returns(),
     }
     worker.handleKillMessage()
     expect(worker.port.postMessage.calledOnce).toBe(true)
@@ -43,24 +43,24 @@ describe('Thread worker test suite', () => {
     }
     const worker = new ThreadWorker({ fn1, fn2 })
     worker.port = {
-      postMessage: stub().returns()
+      postMessage: stub().returns(),
     }
     expect(worker.removeTaskFunction(0, fn1)).toStrictEqual({
       status: false,
-      error: new TypeError('name parameter is not a string')
+      error: new TypeError('name parameter is not a string'),
     })
     expect(worker.removeTaskFunction('', fn1)).toStrictEqual({
       status: false,
-      error: new TypeError('name parameter is an empty string')
+      error: new TypeError('name parameter is an empty string'),
     })
     expect(worker.taskFunctions.get(DEFAULT_TASK_NAME)).toStrictEqual({
-      taskFunction: expect.any(Function)
+      taskFunction: expect.any(Function),
     })
     expect(worker.taskFunctions.get('fn1')).toStrictEqual({
-      taskFunction: expect.any(Function)
+      taskFunction: expect.any(Function),
     })
     expect(worker.taskFunctions.get('fn2')).toStrictEqual({
-      taskFunction: expect.any(Function)
+      taskFunction: expect.any(Function),
     })
     expect(worker.taskFunctions.size).toBe(3)
     expect(worker.taskFunctions.get(DEFAULT_TASK_NAME)).toStrictEqual(
@@ -70,20 +70,20 @@ describe('Thread worker test suite', () => {
       status: false,
       error: new Error(
         'Cannot remove the task function with the default reserved name'
-      )
+      ),
     })
     expect(worker.removeTaskFunction('fn1')).toStrictEqual({
       status: false,
       error: new Error(
         'Cannot remove the task function used as the default task function'
-      )
+      ),
     })
     worker.removeTaskFunction('fn2')
     expect(worker.taskFunctions.get(DEFAULT_TASK_NAME)).toStrictEqual({
-      taskFunction: expect.any(Function)
+      taskFunction: expect.any(Function),
     })
     expect(worker.taskFunctions.get('fn1')).toStrictEqual({
-      taskFunction: expect.any(Function)
+      taskFunction: expect.any(Function),
     })
     expect(worker.taskFunctions.get('fn2')).toBeUndefined()
     expect(worker.taskFunctions.size).toBe(2)
diff --git a/tsdoc.json b/tsdoc.json
deleted file mode 100644 (file)
index 8fcf56d..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-{
-  "$schema": "https://developer.microsoft.com/json-schemas/tsdoc/v0/tsdoc.schema.json",
-  "extends": ["typedoc/tsdoc.json"],
-  "tagDefinitions": [
-    {
-      "tagName": "@author",
-      "syntaxKind": "block"
-    },
-    {
-      "tagName": "@since",
-      "syntaxKind": "block"
-    }
-  ]
-}
index 86f160da4960b68f9ec2c39a5b053ae14354372a..cc33cb68677865f7af0ce5577e2bc0adbbd33ad2 100644 (file)
@@ -5,7 +5,7 @@ import { fileURLToPath } from 'node:url'
 
 try {
   mkdirSync(join(dirname(fileURLToPath(import.meta.url)), 'tmp'), {
-    recursive: true
+    recursive: true,
   })
   const markdownFiles = readdirSync(
     join(dirname(fileURLToPath(import.meta.url)), 'docs')
@@ -25,7 +25,7 @@ try {
   }
   rmSync(join(dirname(fileURLToPath(import.meta.url)), 'tmp'), {
     recursive: true,
-    force: true
+    force: true,
   })
 } catch (e) {
   console.error(e)