From 3a5027122ca6401ae1d755843b20f714c61e3240 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Thu, 30 May 2024 21:10:09 +0200 Subject: [PATCH] chore: migrate to eslint 9 MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- .eslintignore | 4 - .eslintrc.cjs | 189 --- .lintstagedrc.js | 4 +- .vscode/settings.json | 2 + benchmarks/benchmarks-types.cjs | 2 +- benchmarks/benchmarks-utils.cjs | 16 +- benchmarks/benchmarks-utils.mjs | 20 +- benchmarks/internal/bench.mjs | 27 +- benchmarks/internal/cluster-worker.cjs | 1 + benchmarks/internal/thread-worker.mjs | 1 + benchmarks/worker-selection/least.mjs | 61 + benchmarks/worker-selection/round-robin.mjs | 16 + examples/javascript/dynamicExample.cjs | 4 +- examples/javascript/fixedExample.cjs | 4 +- examples/javascript/multiFunctionExample.cjs | 2 +- examples/javascript/multiFunctionWorker.cjs | 8 + examples/javascript/yourWorker.cjs | 5 +- .../typescript/http-client-pool/src/pool.ts | 4 +- .../typescript/http-client-pool/src/types.ts | 2 +- .../typescript/http-client-pool/src/worker.ts | 15 +- .../express-cluster/rollup.config.ts | 12 +- .../express-cluster/src/main.ts | 2 +- .../express-cluster/src/worker.ts | 7 +- .../express-hybrid/rollup.config.ts | 14 +- .../express-hybrid/src/express-worker.ts | 21 +- .../express-hybrid/src/main.ts | 6 +- .../src/request-handler-worker.ts | 13 +- .../express-worker_threads/src/pool.ts | 8 +- .../express-worker_threads/src/worker.ts | 11 +- .../fastify-cluster/rollup.config.ts | 12 +- .../fastify-cluster/src/main.ts | 2 +- .../fastify-cluster/src/worker.ts | 7 +- .../fastify-hybrid/rollup.config.ts | 14 +- .../fastify-hybrid/src/fastify-poolifier.ts | 10 +- .../fastify-hybrid/src/fastify-worker.ts | 11 +- .../fastify-hybrid/src/main.ts | 6 +- .../src/request-handler-worker.ts | 13 +- .../src/fastify-poolifier.ts | 10 +- .../fastify-worker_threads/src/main.ts | 6 +- .../fastify-worker_threads/src/worker.ts | 11 +- examples/typescript/pool.ts | 7 +- .../typescript/smtp-client-pool/src/main.ts | 8 +- .../typescript/smtp-client-pool/src/pool.ts | 8 +- .../typescript/smtp-client-pool/src/worker.ts | 7 +- .../ws-cluster/requests.js | 1 - .../ws-cluster/rollup.config.ts | 12 +- .../ws-cluster/src/main.ts | 2 +- .../ws-cluster/src/worker.ts | 15 +- .../ws-hybrid/requests.js | 1 - .../ws-hybrid/rollup.config.ts | 14 +- .../ws-hybrid/src/main.ts | 6 +- .../ws-hybrid/src/request-handler-worker.ts | 13 +- .../ws-hybrid/src/websocket-server-worker.ts | 26 +- .../ws-worker_threads/requests.js | 1 - .../ws-worker_threads/src/main.ts | 5 +- .../ws-worker_threads/src/pool.ts | 8 +- .../ws-worker_threads/src/worker.ts | 11 +- examples/typescript/worker.ts | 2 +- package.json | 15 +- pnpm-lock.yaml | 1463 +++++++++++------ rollup.config.mjs | 36 +- src/circular-buffer.ts | 7 - src/fixed-priority-queue.ts | 18 +- src/index.ts | 16 +- src/pools/abstract-pool.ts | 168 +- src/pools/cluster/dynamic.ts | 2 - src/pools/cluster/fixed.ts | 7 +- src/pools/pool.ts | 41 +- .../abstract-worker-choice-strategy.ts | 15 +- .../fair-share-worker-choice-strategy.ts | 16 +- ...hted-round-robin-worker-choice-strategy.ts | 11 +- .../least-busy-worker-choice-strategy.ts | 9 +- .../least-elu-worker-choice-strategy.ts | 7 +- .../least-used-worker-choice-strategy.ts | 3 +- .../round-robin-worker-choice-strategy.ts | 3 +- .../selection-strategies-types.ts | 18 +- .../selection-strategies-utils.ts | 21 +- ...hted-round-robin-worker-choice-strategy.ts | 9 +- .../worker-choice-strategies-context.ts | 29 +- src/pools/thread/dynamic.ts | 2 - src/pools/thread/fixed.ts | 9 +- src/pools/utils.ts | 20 +- src/pools/worker-node.ts | 38 +- src/pools/worker.ts | 30 +- src/priority-queue.ts | 12 +- src/utility-types.ts | 7 - src/utils.ts | 21 +- src/worker/abstract-worker.ts | 92 +- src/worker/cluster-worker.ts | 8 +- src/worker/task-functions.ts | 11 +- src/worker/thread-worker.ts | 11 +- src/worker/utils.ts | 3 +- src/worker/worker-options.ts | 9 +- tests/circular-buffer.test.mjs | 2 +- tests/fixed-priority-queue.test.mjs | 24 +- tests/pools/abstract-pool.test.mjs | 296 ++-- tests/pools/cluster/dynamic.test.mjs | 19 +- tests/pools/cluster/fixed.test.mjs | 34 +- .../selection-strategies-utils.test.mjs | 14 +- .../selection-strategies.test.mjs | 382 ++--- .../worker-choice-strategies-context.test.mjs | 20 +- tests/pools/thread/dynamic.test.mjs | 19 +- tests/pools/thread/fixed.test.mjs | 36 +- tests/pools/utils.test.mjs | 20 +- tests/pools/worker-node.test.mjs | 92 +- tests/priority-queue.test.mjs | 34 +- tests/test-types.cjs | 2 +- tests/test-utils.cjs | 12 +- tests/utils.test.mjs | 4 +- .../worker-files/cluster/asyncErrorWorker.cjs | 6 +- tests/worker-files/cluster/asyncWorker.cjs | 6 +- tests/worker-files/cluster/echoWorker.cjs | 6 +- tests/worker-files/cluster/emptyWorker.cjs | 5 +- tests/worker-files/cluster/errorWorker.cjs | 5 +- .../cluster/longRunningWorkerHardBehavior.cjs | 6 +- .../cluster/longRunningWorkerSoftBehavior.cjs | 6 +- .../testMultipleTaskFunctionsWorker.cjs | 6 +- .../cluster/testTaskFunctionObjectsWorker.cjs | 8 +- tests/worker-files/cluster/testWorker.cjs | 6 +- .../worker-files/thread/asyncErrorWorker.mjs | 2 +- tests/worker-files/thread/asyncWorker.mjs | 2 +- tests/worker-files/thread/echoWorker.mjs | 2 +- tests/worker-files/thread/emptyWorker.mjs | 2 +- tests/worker-files/thread/errorWorker.mjs | 2 +- .../thread/longRunningWorkerHardBehavior.mjs | 2 +- .../thread/longRunningWorkerSoftBehavior.mjs | 2 +- .../testMultipleTaskFunctionsWorker.mjs | 6 +- .../thread/testTaskFunctionObjectsWorker.mjs | 8 +- tests/worker-files/thread/testWorker.mjs | 2 +- tests/worker/abstract-worker.test.mjs | 88 +- tests/worker/cluster-worker.test.mjs | 26 +- tests/worker/thread-worker.test.mjs | 24 +- tsdoc.json | 14 - typedoc.mjs | 4 +- 134 files changed, 2148 insertions(+), 2025 deletions(-) delete mode 100644 .eslintignore delete mode 100644 .eslintrc.cjs delete mode 100644 tsdoc.json diff --git a/.eslintignore b/.eslintignore deleted file mode 100644 index f2ad06fb..00000000 --- a/.eslintignore +++ /dev/null @@ -1,4 +0,0 @@ -docs/ -dist/ -lib/ -outputs/ diff --git a/.eslintrc.cjs b/.eslintrc.cjs deleted file mode 100644 index a28991af..00000000 --- a/.eslintrc.cjs +++ /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' - } - } - ] -}) diff --git a/.lintstagedrc.js b/.lintstagedrc.js index aca15ab7..8cdf685f 100644 --- a/.lintstagedrc.js +++ b/.lintstagedrc.js @@ -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'], } diff --git a/.vscode/settings.json b/.vscode/settings.json index b014abda..ebec4d23 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -36,6 +36,7 @@ "mochawesome", "MYBENCH", "nanothreads", + "neostandard", "npmjs", "nproc", "octocat", @@ -58,6 +59,7 @@ "tinypool", "trimmable", "tsdoc", + "tseslint", "typedoc", "workerpool" ], diff --git a/benchmarks/benchmarks-types.cjs b/benchmarks/benchmarks-types.cjs index eaaf05d1..f99a1501 100644 --- a/benchmarks/benchmarks-types.cjs +++ b/benchmarks/benchmarks-types.cjs @@ -2,7 +2,7 @@ const TaskFunctions = { jsonIntegerSerialization: 'jsonIntegerSerialization', fibonacci: 'fibonacci', factorial: 'factorial', - readWriteFiles: 'readWriteFiles' + readWriteFiles: 'readWriteFiles', } module.exports = { TaskFunctions } diff --git a/benchmarks/benchmarks-utils.cjs b/benchmarks/benchmarks-utils.cjs index c3b470f7..f212c7b2 100644 --- a/benchmarks/benchmarks-utils.cjs +++ b/benchmarks/benchmarks-utils.cjs @@ -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, } diff --git a/benchmarks/benchmarks-utils.mjs b/benchmarks/benchmarks-utils.mjs index 16a65610..6c01efcb 100644 --- a/benchmarks/benchmarks-utils.mjs +++ b/benchmarks/benchmarks-utils.mjs @@ -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), {}) diff --git a/benchmarks/internal/bench.mjs b/benchmarks/internal/bench.mjs index 3f467f9e..8bae6aaf 100644 --- a/benchmarks/internal/bench.mjs +++ b/benchmarks/internal/bench.mjs @@ -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 diff --git a/benchmarks/internal/cluster-worker.cjs b/benchmarks/internal/cluster-worker.cjs index 5f59d49b..40d614c7 100644 --- a/benchmarks/internal/cluster-worker.cjs +++ b/benchmarks/internal/cluster-worker.cjs @@ -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 } diff --git a/benchmarks/internal/thread-worker.mjs b/benchmarks/internal/thread-worker.mjs index 232881b5..a5873926 100644 --- a/benchmarks/internal/thread-worker.mjs +++ b/benchmarks/internal/thread-worker.mjs @@ -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 diff --git a/benchmarks/worker-selection/least.mjs b/benchmarks/worker-selection/least.mjs index 4be3826f..5c9ff1ba 100644 --- a/benchmarks/worker-selection/least.mjs +++ b/benchmarks/worker-selection/least.mjs @@ -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) diff --git a/benchmarks/worker-selection/round-robin.mjs b/benchmarks/worker-selection/round-robin.mjs index 82892450..d39fd699 100644 --- a/benchmarks/worker-selection/round-robin.mjs +++ b/benchmarks/worker-selection/round-robin.mjs @@ -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++ diff --git a/examples/javascript/dynamicExample.cjs b/examples/javascript/dynamicExample.cjs index a72ce3a6..ac361d08 100644 --- a/examples/javascript/dynamicExample.cjs +++ b/examples/javascript/dynamicExample.cjs @@ -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 diff --git a/examples/javascript/fixedExample.cjs b/examples/javascript/fixedExample.cjs index f191aa24..ac2c3bee 100644 --- a/examples/javascript/fixedExample.cjs +++ b/examples/javascript/fixedExample.cjs @@ -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 diff --git a/examples/javascript/multiFunctionExample.cjs b/examples/javascript/multiFunctionExample.cjs index 643d117a..9f92c132 100644 --- a/examples/javascript/multiFunctionExample.cjs +++ b/examples/javascript/multiFunctionExample.cjs @@ -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), } ) diff --git a/examples/javascript/multiFunctionWorker.cjs b/examples/javascript/multiFunctionWorker.cjs index da8f972f..d49962d6 100644 --- a/examples/javascript/multiFunctionWorker.cjs +++ b/examples/javascript/multiFunctionWorker.cjs @@ -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}'` } diff --git a/examples/javascript/yourWorker.cjs b/examples/javascript/yourWorker.cjs index 073253ea..fce399bd 100644 --- a/examples/javascript/yourWorker.cjs +++ b/examples/javascript/yourWorker.cjs @@ -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) } diff --git a/examples/typescript/http-client-pool/src/pool.ts b/examples/typescript/http-client-pool/src/pool.ts index 6988372e..83bec2fd 100644 --- a/examples/typescript/http-client-pool/src/pool.ts +++ b/examples/typescript/http-client-pool/src/pool.ts @@ -17,10 +17,10 @@ export const httpClientPool = new DynamicThreadPool( { enableTasksQueue: true, tasksQueueOptions: { - concurrency: 8 + concurrency: 8, }, errorHandler: (e: Error) => { console.error('Thread worker error:', e) - } + }, } ) diff --git a/examples/typescript/http-client-pool/src/types.ts b/examples/typescript/http-client-pool/src/types.ts index 9b35949c..d21087dd 100644 --- a/examples/typescript/http-client-pool/src/types.ts +++ b/examples/typescript/http-client-pool/src/types.ts @@ -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 { diff --git a/examples/typescript/http-client-pool/src/worker.ts b/examples/typescript/http-client-pool/src/worker.ts index 904279b4..95917d64 100644 --- a/examples/typescript/http-client-pool/src/worker.ts +++ b/examples/typescript/http-client-pool/src/worker.ts @@ -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 { 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, } - } + }, }) } } diff --git a/examples/typescript/http-server-pool/express-cluster/rollup.config.ts b/examples/typescript/http-server-pool/express-cluster/rollup.config.ts index 236d018c..2fd37607 100644 --- a/examples/typescript/http-server-pool/express-cluster/rollup.config.ts +++ b/examples/typescript/http-server-pool/express-cluster/rollup.config.ts @@ -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/*'], + }), + ], }) diff --git a/examples/typescript/http-server-pool/express-cluster/src/main.ts b/examples/typescript/http-server-pool/express-cluster/src/main.ts index 8922c9fd..eeb196a6 100644 --- a/examples/typescript/http-server-pool/express-cluster/src/main.ts +++ b/examples/typescript/http-server-pool/express-cluster/src/main.ts @@ -32,6 +32,6 @@ const pool = new FixedClusterPool( }, errorHandler: (e: Error) => { console.error('Cluster worker error:', e) - } + }, } ) diff --git a/examples/typescript/http-server-pool/express-cluster/src/worker.ts b/examples/typescript/http-server-pool/express-cluster/src/worker.ts index 4659e00a..af25b056 100644 --- a/examples/typescript/http-server-pool/express-cluster/src/worker.ts +++ b/examples/typescript/http-server-pool/express-cluster/src/worker.ts @@ -25,6 +25,7 @@ class ExpressWorker extends ClusterWorker { 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 { 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 { }) return { status: true, - port: listenerPort ?? port + port: listenerPort ?? port, } } @@ -62,7 +63,7 @@ class ExpressWorker extends ClusterWorker { super(ExpressWorker.startExpress, { killHandler: () => { ExpressWorker.server.close() - } + }, }) } } diff --git a/examples/typescript/http-server-pool/express-hybrid/rollup.config.ts b/examples/typescript/http-server-pool/express-hybrid/rollup.config.ts index 9c29f004..cd2a4a98 100644 --- a/examples/typescript/http-server-pool/express-hybrid/rollup.config.ts +++ b/examples/typescript/http-server-pool/express-hybrid/rollup.config.ts @@ -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/*'], + }), + ], }) diff --git a/examples/typescript/http-server-pool/express-hybrid/src/express-worker.ts b/examples/typescript/http-server-pool/express-hybrid/src/express-worker.ts index bde3ad4e..360cf913 100644 --- a/examples/typescript/http-server-pool/express-hybrid/src/express-worker.ts +++ b/examples/typescript/http-server-pool/express-hybrid/src/express-worker.ts @@ -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, - ThreadWorkerResponse + ThreadWorkerData, + ThreadWorkerResponse > 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, - ThreadWorkerResponse + ThreadWorkerData, + ThreadWorkerResponse >( 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() - } + }, }) } } diff --git a/examples/typescript/http-server-pool/express-hybrid/src/main.ts b/examples/typescript/http-server-pool/express-hybrid/src/main.ts index 69a329b6..1406248f 100644 --- a/examples/typescript/http-server-pool/express-hybrid/src/main.ts +++ b/examples/typescript/http-server-pool/express-hybrid/src/main.ts @@ -31,11 +31,11 @@ const pool = new FixedClusterPool( 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( }, errorHandler: (e: Error) => { console.error('Cluster worker error:', e) - } + }, } ) diff --git a/examples/typescript/http-server-pool/express-hybrid/src/request-handler-worker.ts b/examples/typescript/http-server-pool/express-hybrid/src/request-handler-worker.ts index 5dbc1137..5297de12 100644 --- a/examples/typescript/http-server-pool/express-hybrid/src/request-handler-worker.ts +++ b/examples/typescript/http-server-pool/express-hybrid/src/request-handler-worker.ts @@ -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, -ThreadWorkerResponse + ThreadWorkerData, + ThreadWorkerResponse >() diff --git a/examples/typescript/http-server-pool/express-worker_threads/src/pool.ts b/examples/typescript/http-server-pool/express-worker_threads/src/pool.ts index 0f6a7acc..29bf4ef7 100644 --- a/examples/typescript/http-server-pool/express-worker_threads/src/pool.ts +++ b/examples/typescript/http-server-pool/express-worker_threads/src/pool.ts @@ -11,14 +11,14 @@ const workerFile = join( ) export const requestHandlerPool = new DynamicThreadPool< -WorkerData, -WorkerResponse + WorkerData, + WorkerResponse >(1, availableParallelism(), workerFile, { enableTasksQueue: true, tasksQueueOptions: { - concurrency: 8 + concurrency: 8, }, errorHandler: (e: Error) => { console.error('Thread worker error:', e) - } + }, }) diff --git a/examples/typescript/http-server-pool/express-worker_threads/src/worker.ts b/examples/typescript/http-server-pool/express-worker_threads/src/worker.ts index 09810907..c5819f83 100644 --- a/examples/typescript/http-server-pool/express-worker_threads/src/worker.ts +++ b/examples/typescript/http-server-pool/express-worker_threads/src/worker.ts @@ -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, -WorkerResponse + WorkerData, + WorkerResponse >() diff --git a/examples/typescript/http-server-pool/fastify-cluster/rollup.config.ts b/examples/typescript/http-server-pool/fastify-cluster/rollup.config.ts index 5e0a32d4..03cbd852 100644 --- a/examples/typescript/http-server-pool/fastify-cluster/rollup.config.ts +++ b/examples/typescript/http-server-pool/fastify-cluster/rollup.config.ts @@ -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/*'], + }), + ], }) diff --git a/examples/typescript/http-server-pool/fastify-cluster/src/main.ts b/examples/typescript/http-server-pool/fastify-cluster/src/main.ts index 541f0017..794a93b6 100644 --- a/examples/typescript/http-server-pool/fastify-cluster/src/main.ts +++ b/examples/typescript/http-server-pool/fastify-cluster/src/main.ts @@ -32,6 +32,6 @@ const pool = new FixedClusterPool( }, errorHandler: (e: Error) => { console.error('Cluster worker error:', e) - } + }, } ) diff --git a/examples/typescript/http-server-pool/fastify-cluster/src/worker.ts b/examples/typescript/http-server-pool/fastify-cluster/src/worker.ts index e491fa8f..7003e265 100644 --- a/examples/typescript/http-server-pool/fastify-cluster/src/worker.ts +++ b/examples/typescript/http-server-pool/fastify-cluster/src/worker.ts @@ -24,10 +24,11 @@ class FastifyWorker extends ClusterWorker { private static readonly startFastify = async ( workerData?: WorkerData ): Promise => { + // 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 { 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 { super(FastifyWorker.startFastify, { killHandler: async () => { await FastifyWorker.fastify.close() - } + }, }) } } diff --git a/examples/typescript/http-server-pool/fastify-hybrid/rollup.config.ts b/examples/typescript/http-server-pool/fastify-hybrid/rollup.config.ts index 6bb949aa..ae79b9bc 100644 --- a/examples/typescript/http-server-pool/fastify-hybrid/rollup.config.ts +++ b/examples/typescript/http-server-pool/fastify-hybrid/rollup.config.ts @@ -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/*'], + }), + ], }) diff --git a/examples/typescript/http-server-pool/fastify-hybrid/src/fastify-poolifier.ts b/examples/typescript/http-server-pool/fastify-hybrid/src/fastify-poolifier.ts index b4369082..753f6df1 100644 --- a/examples/typescript/http-server-pool/fastify-hybrid/src/fastify-poolifier.ts +++ b/examples/typescript/http-server-pool/fastify-hybrid/src/fastify-poolifier.ts @@ -7,7 +7,7 @@ import { availableParallelism, DynamicThreadPool } from 'poolifier' import type { FastifyPoolifierOptions, ThreadWorkerData, - ThreadWorkerResponse + ThreadWorkerResponse, } from './types.js' const fastifyPoolifierPlugin: FastifyPluginCallback = ( @@ -18,13 +18,15 @@ const fastifyPoolifierPlugin: FastifyPluginCallback = ( options = { ...{ minWorkers: 1, - maxWorkers: availableParallelism() + maxWorkers: availableParallelism(), }, - ...options + ...options, } const { workerFile, minWorkers, maxWorkers, ...poolOptions } = options const pool = new DynamicThreadPool( + // 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 = ( export const fastifyPoolifier = fp(fastifyPoolifierPlugin, { fastify: '4.x', - name: 'fastify-poolifier' + name: 'fastify-poolifier', }) diff --git a/examples/typescript/http-server-pool/fastify-hybrid/src/fastify-worker.ts b/examples/typescript/http-server-pool/fastify-hybrid/src/fastify-worker.ts index 8e4713cf..4a697f3e 100644 --- a/examples/typescript/http-server-pool/fastify-hybrid/src/fastify-worker.ts +++ b/examples/typescript/http-server-pool/fastify-hybrid/src/fastify-worker.ts @@ -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 => { + // 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() - } + }, }) } } diff --git a/examples/typescript/http-server-pool/fastify-hybrid/src/main.ts b/examples/typescript/http-server-pool/fastify-hybrid/src/main.ts index fea592c4..4622324c 100644 --- a/examples/typescript/http-server-pool/fastify-hybrid/src/main.ts +++ b/examples/typescript/http-server-pool/fastify-hybrid/src/main.ts @@ -31,11 +31,11 @@ const pool = new FixedClusterPool( : 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( }, errorHandler: (e: Error) => { console.error('Cluster worker error:', e) - } + }, } ) diff --git a/examples/typescript/http-server-pool/fastify-hybrid/src/request-handler-worker.ts b/examples/typescript/http-server-pool/fastify-hybrid/src/request-handler-worker.ts index 5dbc1137..5297de12 100644 --- a/examples/typescript/http-server-pool/fastify-hybrid/src/request-handler-worker.ts +++ b/examples/typescript/http-server-pool/fastify-hybrid/src/request-handler-worker.ts @@ -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, -ThreadWorkerResponse + ThreadWorkerData, + ThreadWorkerResponse >() diff --git a/examples/typescript/http-server-pool/fastify-worker_threads/src/fastify-poolifier.ts b/examples/typescript/http-server-pool/fastify-worker_threads/src/fastify-poolifier.ts index c031d287..451fcb80 100644 --- a/examples/typescript/http-server-pool/fastify-worker_threads/src/fastify-poolifier.ts +++ b/examples/typescript/http-server-pool/fastify-worker_threads/src/fastify-poolifier.ts @@ -7,7 +7,7 @@ import { availableParallelism, DynamicThreadPool } from 'poolifier' import type { FastifyPoolifierOptions, WorkerData, - WorkerResponse + WorkerResponse, } from './types.js' const fastifyPoolifierPlugin: FastifyPluginCallback = ( @@ -18,13 +18,15 @@ const fastifyPoolifierPlugin: FastifyPluginCallback = ( options = { ...{ minWorkers: 1, - maxWorkers: availableParallelism() + maxWorkers: availableParallelism(), }, - ...options + ...options, } const { workerFile, minWorkers, maxWorkers, ...poolOptions } = options const pool = new DynamicThreadPool( + // 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 = ( export const fastifyPoolifier = fp(fastifyPoolifierPlugin, { fastify: '4.x', - name: 'fastify-poolifier' + name: 'fastify-poolifier', }) diff --git a/examples/typescript/http-server-pool/fastify-worker_threads/src/main.ts b/examples/typescript/http-server-pool/fastify-worker_threads/src/main.ts index 5610bc1d..d30e913c 100644 --- a/examples/typescript/http-server-pool/fastify-worker_threads/src/main.ts +++ b/examples/typescript/http-server-pool/fastify-worker_threads/src/main.ts @@ -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 => { diff --git a/examples/typescript/http-server-pool/fastify-worker_threads/src/worker.ts b/examples/typescript/http-server-pool/fastify-worker_threads/src/worker.ts index 09810907..c5819f83 100644 --- a/examples/typescript/http-server-pool/fastify-worker_threads/src/worker.ts +++ b/examples/typescript/http-server-pool/fastify-worker_threads/src/worker.ts @@ -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, -WorkerResponse + WorkerData, + WorkerResponse >() diff --git a/examples/typescript/pool.ts b/examples/typescript/pool.ts index 3965e1f0..5d3d8e75 100644 --- a/examples/typescript/pool.ts +++ b/examples/typescript/pool.ts @@ -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( }, errorHandler: (e: Error) => { console.error(e) - } + }, } ) @@ -39,13 +39,12 @@ const dynamicPool = new DynamicThreadPool( }, 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() diff --git a/examples/typescript/smtp-client-pool/src/main.ts b/examples/typescript/smtp-client-pool/src/main.ts index 620bdb94..e00372dc 100644 --- a/examples/typescript/smtp-client-pool/src/main.ts +++ b/examples/typescript/smtp-client-pool/src/main.ts @@ -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" ', to, subject: 'Hello', text: 'Hello world?', - html: 'Hello world?' - } + html: 'Hello world?', + }, }) ) } diff --git a/examples/typescript/smtp-client-pool/src/pool.ts b/examples/typescript/smtp-client-pool/src/pool.ts index 315bf4ea..74783703 100644 --- a/examples/typescript/smtp-client-pool/src/pool.ts +++ b/examples/typescript/smtp-client-pool/src/pool.ts @@ -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) - } + }, }) diff --git a/examples/typescript/smtp-client-pool/src/worker.ts b/examples/typescript/smtp-client-pool/src/worker.ts index 62288635..e2667b32 100644 --- a/examples/typescript/smtp-client-pool/src/worker.ts +++ b/examples/typescript/smtp-client-pool/src/worker.ts @@ -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 ) - } + }, }) } } diff --git a/examples/typescript/websocket-server-pool/ws-cluster/requests.js b/examples/typescript/websocket-server-pool/ws-cluster/requests.js index 9beb2b78..2c73376f 100644 --- a/examples/typescript/websocket-server-pool/ws-cluster/requests.js +++ b/examples/typescript/websocket-server-pool/ws-cluster/requests.js @@ -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') diff --git a/examples/typescript/websocket-server-pool/ws-cluster/rollup.config.ts b/examples/typescript/websocket-server-pool/ws-cluster/rollup.config.ts index a4f72126..4080e1ac 100644 --- a/examples/typescript/websocket-server-pool/ws-cluster/rollup.config.ts +++ b/examples/typescript/websocket-server-pool/ws-cluster/rollup.config.ts @@ -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/*'], + }), + ], }) diff --git a/examples/typescript/websocket-server-pool/ws-cluster/src/main.ts b/examples/typescript/websocket-server-pool/ws-cluster/src/main.ts index 16dd38d6..200afb35 100644 --- a/examples/typescript/websocket-server-pool/ws-cluster/src/main.ts +++ b/examples/typescript/websocket-server-pool/ws-cluster/src/main.ts @@ -35,6 +35,6 @@ const pool = new FixedClusterPool( }, errorHandler: (e: Error) => { console.error('Cluster worker error', e) - } + }, } ) diff --git a/examples/typescript/websocket-server-pool/ws-cluster/src/worker.ts b/examples/typescript/websocket-server-pool/ws-cluster/src/worker.ts index 232382f6..a3ab5e28 100644 --- a/examples/typescript/websocket-server-pool/ws-cluster/src/worker.ts +++ b/examples/typescript/websocket-server-pool/ws-cluster/src/worker.ts @@ -6,7 +6,7 @@ import { type MessagePayload, MessageType, type WorkerData, - type WorkerResponse + type WorkerResponse, } from './types.js' class WebSocketServerWorker extends ClusterWorker { @@ -28,6 +28,7 @@ class WebSocketServerWorker extends ClusterWorker { 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 { 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 switch (type) { @@ -48,7 +48,7 @@ class WebSocketServerWorker extends ClusterWorker { ws.send( JSON.stringify({ type: MessageType.echo, - data + data, }) ) break @@ -58,8 +58,9 @@ class WebSocketServerWorker extends ClusterWorker { { 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 { }) return { status: true, - port: WebSocketServerWorker.wss.options.port + port: WebSocketServerWorker.wss.options.port, } } @@ -78,7 +79,7 @@ class WebSocketServerWorker extends ClusterWorker { super(WebSocketServerWorker.startWebSocketServer, { killHandler: () => { WebSocketServerWorker.wss.close() - } + }, }) } } diff --git a/examples/typescript/websocket-server-pool/ws-hybrid/requests.js b/examples/typescript/websocket-server-pool/ws-hybrid/requests.js index 9beb2b78..2c73376f 100644 --- a/examples/typescript/websocket-server-pool/ws-hybrid/requests.js +++ b/examples/typescript/websocket-server-pool/ws-hybrid/requests.js @@ -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') diff --git a/examples/typescript/websocket-server-pool/ws-hybrid/rollup.config.ts b/examples/typescript/websocket-server-pool/ws-hybrid/rollup.config.ts index e96f480b..fb878235 100644 --- a/examples/typescript/websocket-server-pool/ws-hybrid/rollup.config.ts +++ b/examples/typescript/websocket-server-pool/ws-hybrid/rollup.config.ts @@ -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/*'], + }), + ], }) diff --git a/examples/typescript/websocket-server-pool/ws-hybrid/src/main.ts b/examples/typescript/websocket-server-pool/ws-hybrid/src/main.ts index f1c75506..5ba88051 100644 --- a/examples/typescript/websocket-server-pool/ws-hybrid/src/main.ts +++ b/examples/typescript/websocket-server-pool/ws-hybrid/src/main.ts @@ -31,11 +31,11 @@ const pool = new FixedClusterPool( 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( }, errorHandler: (e: Error) => { console.error('Cluster worker error', e) - } + }, } ) diff --git a/examples/typescript/websocket-server-pool/ws-hybrid/src/request-handler-worker.ts b/examples/typescript/websocket-server-pool/ws-hybrid/src/request-handler-worker.ts index 99d30331..444c5179 100644 --- a/examples/typescript/websocket-server-pool/ws-hybrid/src/request-handler-worker.ts +++ b/examples/typescript/websocket-server-pool/ws-hybrid/src/request-handler-worker.ts @@ -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, -ThreadWorkerResponse + ThreadWorkerData, + ThreadWorkerResponse >() diff --git a/examples/typescript/websocket-server-pool/ws-hybrid/src/websocket-server-worker.ts b/examples/typescript/websocket-server-pool/ws-hybrid/src/websocket-server-worker.ts index e52f0c06..6aa993d2 100644 --- a/examples/typescript/websocket-server-pool/ws-hybrid/src/websocket-server-worker.ts +++ b/examples/typescript/websocket-server-pool/ws-hybrid/src/websocket-server-worker.ts @@ -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, - ThreadWorkerResponse + ThreadWorkerData, + ThreadWorkerResponse > 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, - ThreadWorkerResponse + ThreadWorkerData, + ThreadWorkerResponse >( 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 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() - } + }, }) } } diff --git a/examples/typescript/websocket-server-pool/ws-worker_threads/requests.js b/examples/typescript/websocket-server-pool/ws-worker_threads/requests.js index 9beb2b78..2c73376f 100644 --- a/examples/typescript/websocket-server-pool/ws-worker_threads/requests.js +++ b/examples/typescript/websocket-server-pool/ws-worker_threads/requests.js @@ -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') diff --git a/examples/typescript/websocket-server-pool/ws-worker_threads/src/main.ts b/examples/typescript/websocket-server-pool/ws-worker_threads/src/main.ts index 7a162499..2954cbde 100644 --- a/examples/typescript/websocket-server-pool/ws-worker_threads/src/main.ts +++ b/examples/typescript/websocket-server-pool/ws-worker_threads/src/main.ts @@ -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 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) ) diff --git a/examples/typescript/websocket-server-pool/ws-worker_threads/src/pool.ts b/examples/typescript/websocket-server-pool/ws-worker_threads/src/pool.ts index ac8b9c86..1cefa60c 100644 --- a/examples/typescript/websocket-server-pool/ws-worker_threads/src/pool.ts +++ b/examples/typescript/websocket-server-pool/ws-worker_threads/src/pool.ts @@ -11,14 +11,14 @@ const workerFile = join( ) export const requestHandlerPool = new DynamicThreadPool< -WorkerData, -WorkerResponse + WorkerData, + WorkerResponse >(1, availableParallelism(), workerFile, { enableTasksQueue: true, tasksQueueOptions: { - concurrency: 8 + concurrency: 8, }, errorHandler: (e: Error) => { console.error('Thread worker error:', e) - } + }, }) diff --git a/examples/typescript/websocket-server-pool/ws-worker_threads/src/worker.ts b/examples/typescript/websocket-server-pool/ws-worker_threads/src/worker.ts index 92baa166..2c4de3e2 100644 --- a/examples/typescript/websocket-server-pool/ws-worker_threads/src/worker.ts +++ b/examples/typescript/websocket-server-pool/ws-worker_threads/src/worker.ts @@ -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, -WorkerResponse + WorkerData, + WorkerResponse >() diff --git a/examples/typescript/worker.ts b/examples/typescript/worker.ts index 1d8af8d9..7ab1fc56 100644 --- a/examples/typescript/worker.ts +++ b/examples/typescript/worker.ts @@ -12,7 +12,7 @@ export interface MyResponse { class MyThreadWorker extends ThreadWorker { constructor () { super(async (data?: MyData) => await this.process(data), { - maxInactiveTime: 60000 + maxInactiveTime: 60000, }) } diff --git a/package.json b/package.json index c1743f26..38b989d6 100644 --- a/package.json +++ b/package.json @@ -104,32 +104,27 @@ "@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", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 7a29e946..0ccb25c5 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -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 diff --git a/rollup.config.mjs b/rollup.config.mjs index 763a3e3c..a6d7eae8 100644 --- a/rollup.config.mjs +++ b/rollup.config.mjs @@ -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(), + ], + }, ]) diff --git a/src/circular-buffer.ts b/src/circular-buffer.ts index 7d12069f..b4a60030 100644 --- a/src/circular-buffer.ts +++ b/src/circular-buffer.ts @@ -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 { diff --git a/src/fixed-priority-queue.ts b/src/fixed-priority-queue.ts index 792f23d7..efcc35ca 100644 --- a/src/fixed-priority-queue.ts +++ b/src/fixed-priority-queue.ts @@ -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 { /** * Fixed priority queue. - * * @typeParam T - Type of fixed priority queue data. * @internal */ export class FixedPriorityQueue { private start!: number - private readonly nodeArray: Array> + private readonly nodeArray: FixedPriorityQueueNode[] /** The fixed priority queue capacity. */ public readonly capacity: number /** The fixed priority queue size. */ @@ -32,7 +30,6 @@ export class FixedPriorityQueue { /** * 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 { /** * 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 { /** * 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 { /** * 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 { /** * 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 { /** * 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 { /** * 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 { if (i >= this.size) { return { value: undefined, - done: true + done: true, } } const value = this.nodeArray[index].data @@ -171,15 +162,14 @@ export class FixedPriorityQueue { } return { value, - done: false + done: false, } - } + }, } } /** * Checks the queue size. - * * @param size - Queue size. */ private checkSize (size: number): void { diff --git a/src/index.ts b/src/index.ts index 5f502d2a..e779bf0c 100644 --- a/src/index.ts +++ b/src/index.ts @@ -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' diff --git a/src/pools/abstract-pool.ts b/src/pools/abstract-pool.ts index 8f57a906..c8a87251 100644 --- a/src/pools/abstract-pool.ts +++ b/src/pools/abstract-pool.ts @@ -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 { /** @inheritDoc */ - public readonly workerNodes: Array> = [] + public readonly workerNodes: IWorkerNode[] = [] /** @inheritDoc */ public emitter?: EventEmitterAsyncResource @@ -95,19 +94,19 @@ export abstract class AbstractPool< */ protected promiseResponseMap: Map< `${string}-${string}-${string}-${string}-${string}`, - PromiseResponseWrapper + PromiseResponseWrapper > = new Map< `${string}-${string}-${string}-${string}-${string}`, PromiseResponseWrapper - >() + >() /** * 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 + string, + TaskFunctionObject > /** @@ -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 = { 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 { await new Promise((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 { @@ -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 ): 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 ): 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): 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 @@ -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 { @@ -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): 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. */ diff --git a/src/pools/cluster/dynamic.ts b/src/pools/cluster/dynamic.ts index 51d1cbee..47799f5e 100644 --- a/src/pools/cluster/dynamic.ts +++ b/src/pools/cluster/dynamic.ts @@ -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 { /** * 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. diff --git a/src/pools/cluster/fixed.ts b/src/pools/cluster/fixed.ts index 4a8cb4f1..51a891bf 100644 --- a/src/pools/cluster/fixed.ts +++ b/src/pools/cluster/fixed.ts @@ -12,7 +12,6 @@ export type ClusterPoolOptions = PoolOptions /** * 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 { /** * 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) } /** @inheritDoc */ protected sendStartupMessageToWorker (workerNodeKey: number): void { this.sendToWorker(workerNodeKey, { - ready: false + ready: false, }) } diff --git a/src/pools/pool.ts b/src/pools/pool.ts index a025f3ce..c2d54987 100644 --- a/src/pools/pool.ts +++ b/src/pools/pool.ts @@ -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 { /** * A function that will listen for online event on each worker. - * * @defaultValue `() => {}` */ onlineHandler?: OnlineHandler /** * A function that will listen for message event on each worker. - * * @defaultValue `() => {}` */ messageHandler?: MessageHandler /** * A function that will listen for error event on each worker. - * * @defaultValue `() => {}` */ errorHandler?: ErrorHandler /** * A function that will listen for exit event on each worker. - * * @defaultValue `() => {}` */ exitHandler?: ExitHandler /** * 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 { 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 { 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 /** * Cluster settings. - * * @see https://nodejs.org/api/cluster.html#cluster_cluster_settings */ settings?: ClusterSettings @@ -257,7 +240,6 @@ export interface PoolOptions { /** * 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> + readonly workerNodes: IWorkerNode[] /** * Pool event emitter integrated with async resource. * The async tracking tooling identifier is `poolifier:--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 /** * 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 /** * 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 /** * 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 /** * 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 diff --git a/src/pools/selection-strategies/abstract-worker-choice-strategy.ts b/src/pools/selection-strategies/abstract-worker-choice-strategy.ts index 2b40f0c6..f4273dcd 100644 --- a/src/pools/selection-strategies/abstract-worker-choice-strategy.ts +++ b/src/pools/selection-strategies/abstract-worker-choice-strategy.ts @@ -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 { diff --git a/src/pools/selection-strategies/fair-share-worker-choice-strategy.ts b/src/pools/selection-strategies/fair-share-worker-choice-strategy.ts index d1a4919d..88e12b94 100644 --- a/src/pools/selection-strategies/fair-share-worker-choice-strategy.ts +++ b/src/pools/selection-strategies/fair-share-worker-choice-strategy.ts @@ -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. */ diff --git a/src/pools/selection-strategies/interleaved-weighted-round-robin-worker-choice-strategy.ts b/src/pools/selection-strategies/interleaved-weighted-round-robin-worker-choice-strategy.ts index 4048924c..61dd2cff 100644 --- a/src/pools/selection-strategies/interleaved-weighted-round-robin-worker-choice-strategy.ts +++ b/src/pools/selection-strategies/interleaved-weighted-round-robin-worker-choice-strategy.ts @@ -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) - ) + ), ] } } diff --git a/src/pools/selection-strategies/least-busy-worker-choice-strategy.ts b/src/pools/selection-strategies/least-busy-worker-choice-strategy.ts index b07a9d1c..33199368 100644 --- a/src/pools/selection-strategies/least-busy-worker-choice-strategy.ts +++ b/src/pools/selection-strategies/least-busy-worker-choice-strategy.ts @@ -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 */ diff --git a/src/pools/selection-strategies/least-elu-worker-choice-strategy.ts b/src/pools/selection-strategies/least-elu-worker-choice-strategy.ts index 6eaaacfb..ead02e85 100644 --- a/src/pools/selection-strategies/least-elu-worker-choice-strategy.ts +++ b/src/pools/selection-strategies/least-elu-worker-choice-strategy.ts @@ -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 */ diff --git a/src/pools/selection-strategies/least-used-worker-choice-strategy.ts b/src/pools/selection-strategies/least-used-worker-choice-strategy.ts index 601b72be..1ee6b7b8 100644 --- a/src/pools/selection-strategies/least-used-worker-choice-strategy.ts +++ b/src/pools/selection-strategies/least-used-worker-choice-strategy.ts @@ -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. diff --git a/src/pools/selection-strategies/round-robin-worker-choice-strategy.ts b/src/pools/selection-strategies/round-robin-worker-choice-strategy.ts index 83126d97..1f5c499e 100644 --- a/src/pools/selection-strategies/round-robin-worker-choice-strategy.ts +++ b/src/pools/selection-strategies/round-robin-worker-choice-strategy.ts @@ -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. diff --git a/src/pools/selection-strategies/selection-strategies-types.ts b/src/pools/selection-strategies/selection-strategies-types.ts index 1a8ea298..745b140a 100644 --- a/src/pools/selection-strategies/selection-strategies-types.ts +++ b/src/pools/selection-strategies/selection-strategies-types.ts @@ -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 @@ -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 diff --git a/src/pools/selection-strategies/selection-strategies-utils.ts b/src/pools/selection-strategies/selection-strategies-utils.ts index 3c7f5f4d..07517535 100644 --- a/src/pools/selection-strategies/selection-strategies-utils.ts +++ b/src/pools/selection-strategies/selection-strategies-utils.ts @@ -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 = ( ))(pool, opts) default: throw new Error( - // eslint-disable-next-line @typescript-eslint/restrict-template-expressions `Worker choice strategy '${workerChoiceStrategy}' is not valid` ) } diff --git a/src/pools/selection-strategies/weighted-round-robin-worker-choice-strategy.ts b/src/pools/selection-strategies/weighted-round-robin-worker-choice-strategy.ts index 6ce55c9a..ffd4fc39 100644 --- a/src/pools/selection-strategies/weighted-round-robin-worker-choice-strategy.ts +++ b/src/pools/selection-strategies/weighted-round-robin-worker-choice-strategy.ts @@ -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, } /** diff --git a/src/pools/selection-strategies/worker-choice-strategies-context.ts b/src/pools/selection-strategies/worker-choice-strategies-context.ts index 185fed71..d030a452 100644 --- a/src/pools/selection-strategies/worker-choice-strategies-context.ts +++ b/src/pools/selection-strategies/worker-choice-strategies-context.ts @@ -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, 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. */ diff --git a/src/pools/thread/dynamic.ts b/src/pools/thread/dynamic.ts index 8e795512..0d088da1 100644 --- a/src/pools/thread/dynamic.ts +++ b/src/pools/thread/dynamic.ts @@ -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 { /** * 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. diff --git a/src/pools/thread/fixed.ts b/src/pools/thread/fixed.ts index 7977cd61..85c5c9be 100644 --- a/src/pools/thread/fixed.ts +++ b/src/pools/thread/fixed.ts @@ -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 /** * 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 { /** * 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, transferList ) @@ -71,7 +70,7 @@ export class FixedThreadPool< { ready: false, workerId: this.getWorkerInfo(workerNodeKey)?.id, - port: port2 + port: port2, } satisfies MessageValue, [port2] ) diff --git a/src/pools/utils.ts b/src/pools/utils.ts index d4649d70..3ac39b4d 100644 --- a/src/pools/utils.ts +++ b/src/pools/utils.ts @@ -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 = ( ): 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 = ( type: WorkerType, filePath: string, - opts: { env?: Record, workerOptions?: WorkerOptions } + opts: { env?: Record; 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 diff --git a/src/pools/worker-node.ts b/src/pools/worker-node.ts index f7a48d3b..d29a6e32 100644 --- a/src/pools/worker-node.ts +++ b/src/pools/worker-node.ts @@ -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 /** * 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 checkWorkerNodeArguments(type, filePath, opts) this.worker = createWorker(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 dynamic: false, ready: false, stealing: false, - backPressure: false + backPressure: false, } } @@ -245,22 +243,22 @@ export class WorkerNode }, 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 }, 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), + }, + }, } } } diff --git a/src/pools/worker.ts b/src/pools/worker.ts index c1af1cf7..9f5fc0c1 100644 --- a/src/pools/worker.ts +++ b/src/pools/worker.ts @@ -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 = (this: Worker) => void /** * Callback invoked if the worker has received a message. - * * @typeParam Worker - Type of worker. */ export type MessageHandler = ( @@ -23,7 +21,6 @@ export type MessageHandler = ( /** * Callback invoked if the worker raised an error. - * * @typeParam Worker - Type of worker. */ export type ErrorHandler = ( @@ -33,7 +30,6 @@ export type ErrorHandler = ( /** * Callback invoked when the worker exits successfully. - * * @typeParam Worker - Type of worker. */ export type ExitHandler = ( @@ -43,7 +39,6 @@ export type ExitHandler = ( /** * Worker event handler. - * * @typeParam Worker - Type of worker. */ export type EventHandler = @@ -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 /** * 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 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) => number /** * Dequeue task. - * * @param bucket - The prioritized bucket to dequeue from. @defaultValue 0 * @returns The dequeued task. */ readonly dequeueTask: (bucket?: number) => Task | undefined /** * Dequeue last prioritized task. - * * @returns The dequeued task. */ readonly dequeueLastPrioritizedTask: () => Task | undefined @@ -354,7 +334,6 @@ export interface IWorkerNode 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 readonly terminate: () => Promise /** * Registers a worker event handler. - * * @param event - The event. * @param handler - The event handler. */ @@ -374,7 +352,6 @@ export interface IWorkerNode ) => void /** * Registers once a worker event handler. - * * @param event - The event. * @param handler - The event handler. */ @@ -384,14 +361,12 @@ export interface IWorkerNode ) => 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 node event detail. - * * @internal */ export interface WorkerNodeEventDetail { diff --git a/src/priority-queue.ts b/src/priority-queue.ts index ee3310c3..c613cd2e 100644 --- a/src/priority-queue.ts +++ b/src/priority-queue.ts @@ -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 extends FixedPriorityQueue { /** * Priority queue. - * * @typeParam T - Type of priority queue data. * @internal */ @@ -32,7 +30,6 @@ export class PriorityQueue { /** * 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 { /** * 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 { /** * 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 { /** * 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 { if (value == null) { return { value: undefined, - done: true + done: true, } } ++index @@ -194,9 +188,9 @@ export class PriorityQueue { } return { value, - done: false + done: false, } - } + }, } } } diff --git a/src/utility-types.ts b/src/utility-types.ts index 82f79230..f13cce6a 100644 --- a/src/utility-types.ts +++ b/src/utility-types.ts @@ -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 { @@ -27,7 +26,6 @@ export interface WorkerError { /** * 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 { readonly data?: Data /** * Task priority. Lower values have higher priority. - * * @defaultValue 0 */ readonly priority?: number @@ -124,7 +119,6 @@ export interface Task { /** * 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 /** * 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 */ diff --git a/src/utils.ts b/src/utils.ts index f3822169..af6a432b 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -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 => { /** * 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 = ( /** * 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 = >( ): ((...args: A) => R) => { let result: R return (...args: A) => { - // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition if (fn != null) { result = fn.apply(context, args) ;(fn as unknown as undefined) = (context as unknown as undefined) = @@ -236,10 +221,10 @@ export const buildTaskFunctionProperties = ( return { name, ...(taskFunctionObject?.priority != null && { - priority: taskFunctionObject.priority + priority: taskFunctionObject.priority, }), ...(taskFunctionObject?.strategy != null && { - strategy: taskFunctionObject.strategy - }) + strategy: taskFunctionObject.strategy, + }), } } diff --git a/src/worker/abstract-worker.ts b/src/worker/abstract-worker.ts index bb6ac566..9b9ded5e 100644 --- a/src/worker/abstract-worker.ts +++ b/src/worker/abstract-worker.ts @@ -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 - | TaskFunctions - | undefined + | TaskFunction + | TaskFunctions + | 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(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): void /** * Worker message listener. - * * @param message - The received message. */ protected messageListener (message: MessageValue): 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, ...(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): void { + protected handleKillMessage (message: MessageValue): void { this.stopCheckActive() if (isAsyncFunction(this.opts.killHandler)) { - (this.opts.killHandler() as Promise) + ;(this.opts.killHandler() as Promise) .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): 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), + }), } } diff --git a/src/worker/cluster-worker.ts b/src/worker/cluster-worker.ts index 847f2174..d9f6e647 100644 --- a/src/worker/cluster-worker.ts +++ b/src/worker/cluster-worker.ts @@ -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 { /** * 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) } } diff --git a/src/worker/task-functions.ts b/src/worker/task-functions.ts index 0b3083c3..2fd951fb 100644 --- a/src/worker/task-functions.ts +++ b/src/worker/task-functions.ts @@ -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 = ( /** * 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 = ( /** * 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 = /** * 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 { * 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 = Record< -string, -TaskFunction | TaskFunctionObject + string, + TaskFunction | TaskFunctionObject > /** diff --git a/src/worker/thread-worker.ts b/src/worker/thread-worker.ts index bf8647c5..8057d6f3 100644 --- a/src/worker/thread-worker.ts +++ b/src/worker/thread-worker.ts @@ -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) } /** * @inheritDoc - * @override */ protected handleError (error: Error | string): string { return error as string diff --git a/src/worker/utils.ts b/src/worker/utils.ts index d0883893..f324a235 100644 --- a/src/worker/utils.ts +++ b/src/worker/utils.ts @@ -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` ) } diff --git a/src/worker/worker-options.ts b/src/worker/worker-options.ts index 50cf85bb..92761840 100644 --- a/src/worker/worker-options.ts +++ b/src/worker/worker-options.ts @@ -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 diff --git a/tests/circular-buffer.test.mjs b/tests/circular-buffer.test.mjs index f6afdda9..751ece90 100644 --- a/tests/circular-buffer.test.mjs +++ b/tests/circular-buffer.test.mjs @@ -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) diff --git a/tests/fixed-priority-queue.test.mjs b/tests/fixed-priority-queue.test.mjs index 99dcb001..40b55643 100644 --- a/tests/fixed-priority-queue.test.mjs +++ b/tests/fixed-priority-queue.test.mjs @@ -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 }, ]) }) }) diff --git a/tests/pools/abstract-pool.test.mjs b/tests/pools/abstract-pool.test.mjs index ec8fe516..ec481d2c 100644 --- a/tests/pools/abstract-pool.test.mjs +++ b/tests/pools/abstract-pool.test.mjs @@ -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() diff --git a/tests/pools/cluster/dynamic.test.mjs b/tests/pools/cluster/dynamic.test.mjs index 166498f9..f5094452 100644 --- a/tests/pools/cluster/dynamic.test.mjs +++ b/tests/pools/cluster/dynamic.test.mjs @@ -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() diff --git a/tests/pools/cluster/fixed.test.mjs b/tests/pools/cluster/fixed.test.mjs index 0397c797..a78a4509 100644 --- a/tests/pools/cluster/fixed.test.mjs +++ b/tests/pools/cluster/fixed.test.mjs @@ -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() }) diff --git a/tests/pools/selection-strategies/selection-strategies-utils.test.mjs b/tests/pools/selection-strategies/selection-strategies-utils.test.mjs index dc6fc71f..9b57e789 100644 --- a/tests/pools/selection-strategies/selection-strategies-utils.test.mjs +++ b/tests/pools/selection-strategies/selection-strategies-utils.test.mjs @@ -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) diff --git a/tests/pools/selection-strategies/selection-strategies.test.mjs b/tests/pools/selection-strategies/selection-strategies.test.mjs index 3f2f2e81..e8df7e1a 100644 --- a/tests/pools/selection-strategies/selection-strategies.test.mjs +++ b/tests/pools/selection-strategies/selection-strategies.test.mjs @@ -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( diff --git a/tests/pools/selection-strategies/worker-choice-strategies-context.test.mjs b/tests/pools/selection-strategies/worker-choice-strategies-context.test.mjs index aeb7db17..e046af55 100644 --- a/tests/pools/selection-strategies/worker-choice-strategies-context.test.mjs +++ b/tests/pools/selection-strategies/worker-choice-strategies-context.test.mjs @@ -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( diff --git a/tests/pools/thread/dynamic.test.mjs b/tests/pools/thread/dynamic.test.mjs index 22d89223..97bfbbfc 100644 --- a/tests/pools/thread/dynamic.test.mjs +++ b/tests/pools/thread/dynamic.test.mjs @@ -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() diff --git a/tests/pools/thread/fixed.test.mjs b/tests/pools/thread/fixed.test.mjs index 3da05735..044eb808 100644 --- a/tests/pools/thread/fixed.test.mjs +++ b/tests/pools/thread/fixed.test.mjs @@ -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() }) diff --git a/tests/pools/utils.test.mjs b/tests/pools/utils.test.mjs index f29515d5..21ddaa77 100644 --- a/tests/pools/utils.test.mjs +++ b/tests/pools/utils.test.mjs @@ -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, }) }) diff --git a/tests/pools/worker-node.test.mjs b/tests/pools/worker-node.test.mjs index e47ba103..f00b8061 100644 --- a/tests/pools/worker-node.test.mjs +++ b/tests/pools/worker-node.test.mjs @@ -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( diff --git a/tests/priority-queue.test.mjs b/tests/priority-queue.test.mjs index 5240efd2..839b6057 100644 --- a/tests/priority-queue.test.mjs +++ b/tests/priority-queue.test.mjs @@ -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 }, ]) }) diff --git a/tests/test-types.cjs b/tests/test-types.cjs index 402aa305..707bb160 100644 --- a/tests/test-types.cjs +++ b/tests/test-types.cjs @@ -1,7 +1,7 @@ const TaskFunctions = { jsonIntegerSerialization: 'jsonIntegerSerialization', fibonacci: 'fibonacci', - factorial: 'factorial' + factorial: 'factorial', } module.exports = { TaskFunctions } diff --git a/tests/test-utils.cjs b/tests/test-utils.cjs index 4448eaf6..5006df6e 100644 --- a/tests/test-utils.cjs +++ b/tests/test-utils.cjs @@ -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, } diff --git a/tests/utils.test.mjs b/tests/utils.test.mjs index 6e97797e..b977e102 100644 --- a/tests/utils.test.mjs +++ b/tests/utils.test.mjs @@ -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) diff --git a/tests/worker-files/cluster/asyncErrorWorker.cjs b/tests/worker-files/cluster/asyncErrorWorker.cjs index 022b4536..06797611 100644 --- a/tests/worker-files/cluster/asyncErrorWorker.cjs +++ b/tests/worker-files/cluster/asyncErrorWorker.cjs @@ -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, }) diff --git a/tests/worker-files/cluster/asyncWorker.cjs b/tests/worker-files/cluster/asyncWorker.cjs index d6806891..12897f7d 100644 --- a/tests/worker-files/cluster/asyncWorker.cjs +++ b/tests/worker-files/cluster/asyncWorker.cjs @@ -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, }) diff --git a/tests/worker-files/cluster/echoWorker.cjs b/tests/worker-files/cluster/echoWorker.cjs index 4534d985..5052e18c 100644 --- a/tests/worker-files/cluster/echoWorker.cjs +++ b/tests/worker-files/cluster/echoWorker.cjs @@ -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, }) diff --git a/tests/worker-files/cluster/emptyWorker.cjs b/tests/worker-files/cluster/emptyWorker.cjs index 9c6072af..78f534ab 100644 --- a/tests/worker-files/cluster/emptyWorker.cjs +++ b/tests/worker-files/cluster/emptyWorker.cjs @@ -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, }) diff --git a/tests/worker-files/cluster/errorWorker.cjs b/tests/worker-files/cluster/errorWorker.cjs index 2dcfe625..9a2695b2 100644 --- a/tests/worker-files/cluster/errorWorker.cjs +++ b/tests/worker-files/cluster/errorWorker.cjs @@ -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, }) diff --git a/tests/worker-files/cluster/longRunningWorkerHardBehavior.cjs b/tests/worker-files/cluster/longRunningWorkerHardBehavior.cjs index 2d7de52e..2dfaaafb 100644 --- a/tests/worker-files/cluster/longRunningWorkerHardBehavior.cjs +++ b/tests/worker-files/cluster/longRunningWorkerHardBehavior.cjs @@ -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, }) diff --git a/tests/worker-files/cluster/longRunningWorkerSoftBehavior.cjs b/tests/worker-files/cluster/longRunningWorkerSoftBehavior.cjs index 91eb2b35..4a5bf10f 100644 --- a/tests/worker-files/cluster/longRunningWorkerSoftBehavior.cjs +++ b/tests/worker-files/cluster/longRunningWorkerSoftBehavior.cjs @@ -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, }) diff --git a/tests/worker-files/cluster/testMultipleTaskFunctionsWorker.cjs b/tests/worker-files/cluster/testMultipleTaskFunctionsWorker.cjs index ef785aa1..0f8286a5 100644 --- a/tests/worker-files/cluster/testMultipleTaskFunctionsWorker.cjs +++ b/tests/worker-files/cluster/testMultipleTaskFunctionsWorker.cjs @@ -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, } ) diff --git a/tests/worker-files/cluster/testTaskFunctionObjectsWorker.cjs b/tests/worker-files/cluster/testTaskFunctionObjectsWorker.cjs index fcb6f18a..9f4f4b4f 100644 --- a/tests/worker-files/cluster/testTaskFunctionObjectsWorker.cjs +++ b/tests/worker-files/cluster/testTaskFunctionObjectsWorker.cjs @@ -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, } ) diff --git a/tests/worker-files/cluster/testWorker.cjs b/tests/worker-files/cluster/testWorker.cjs index fd6b2eb2..418afd7c 100644 --- a/tests/worker-files/cluster/testWorker.cjs +++ b/tests/worker-files/cluster/testWorker.cjs @@ -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, }) diff --git a/tests/worker-files/thread/asyncErrorWorker.mjs b/tests/worker-files/thread/asyncErrorWorker.mjs index 9624b6d8..c6fa8910 100644 --- a/tests/worker-files/thread/asyncErrorWorker.mjs +++ b/tests/worker-files/thread/asyncErrorWorker.mjs @@ -17,5 +17,5 @@ async function error (data) { export default new ThreadWorker(error, { killBehavior: KillBehaviors.HARD, - maxInactiveTime: 500 + maxInactiveTime: 500, }) diff --git a/tests/worker-files/thread/asyncWorker.mjs b/tests/worker-files/thread/asyncWorker.mjs index 623d517d..63db364a 100644 --- a/tests/worker-files/thread/asyncWorker.mjs +++ b/tests/worker-files/thread/asyncWorker.mjs @@ -12,5 +12,5 @@ async function sleep (data) { export default new ThreadWorker(sleep, { killBehavior: KillBehaviors.HARD, - maxInactiveTime: 500 + maxInactiveTime: 500, }) diff --git a/tests/worker-files/thread/echoWorker.mjs b/tests/worker-files/thread/echoWorker.mjs index 9a8ae66e..e1ac41ee 100644 --- a/tests/worker-files/thread/echoWorker.mjs +++ b/tests/worker-files/thread/echoWorker.mjs @@ -10,5 +10,5 @@ function echo (data) { } export default new ThreadWorker(echo, { - killBehavior: KillBehaviors.HARD + killBehavior: KillBehaviors.HARD, }) diff --git a/tests/worker-files/thread/emptyWorker.mjs b/tests/worker-files/thread/emptyWorker.mjs index ad4d52bc..7d37eb95 100644 --- a/tests/worker-files/thread/emptyWorker.mjs +++ b/tests/worker-files/thread/emptyWorker.mjs @@ -7,5 +7,5 @@ function test () {} export default new ThreadWorker(test, { killBehavior: KillBehaviors.HARD, - maxInactiveTime: 500 + maxInactiveTime: 500, }) diff --git a/tests/worker-files/thread/errorWorker.mjs b/tests/worker-files/thread/errorWorker.mjs index ec866743..582d094e 100644 --- a/tests/worker-files/thread/errorWorker.mjs +++ b/tests/worker-files/thread/errorWorker.mjs @@ -9,5 +9,5 @@ function error () { export default new ThreadWorker(error, { killBehavior: KillBehaviors.HARD, - maxInactiveTime: 500 + maxInactiveTime: 500, }) diff --git a/tests/worker-files/thread/longRunningWorkerHardBehavior.mjs b/tests/worker-files/thread/longRunningWorkerHardBehavior.mjs index 3d58ab45..1762947a 100644 --- a/tests/worker-files/thread/longRunningWorkerHardBehavior.mjs +++ b/tests/worker-files/thread/longRunningWorkerHardBehavior.mjs @@ -12,5 +12,5 @@ async function sleep (data) { export default new ThreadWorker(sleep, { killBehavior: KillBehaviors.HARD, - maxInactiveTime: 500 + maxInactiveTime: 500, }) diff --git a/tests/worker-files/thread/longRunningWorkerSoftBehavior.mjs b/tests/worker-files/thread/longRunningWorkerSoftBehavior.mjs index 4b7c1500..ae98f767 100644 --- a/tests/worker-files/thread/longRunningWorkerSoftBehavior.mjs +++ b/tests/worker-files/thread/longRunningWorkerSoftBehavior.mjs @@ -11,5 +11,5 @@ async function sleep (data) { } export default new ThreadWorker(sleep, { - maxInactiveTime: 500 + maxInactiveTime: 500, }) diff --git a/tests/worker-files/thread/testMultipleTaskFunctionsWorker.mjs b/tests/worker-files/thread/testMultipleTaskFunctionsWorker.mjs index 94e548ef..7928ab02 100644 --- a/tests/worker-files/thread/testMultipleTaskFunctionsWorker.mjs +++ b/tests/worker-files/thread/testMultipleTaskFunctionsWorker.mjs @@ -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, } ) diff --git a/tests/worker-files/thread/testTaskFunctionObjectsWorker.mjs b/tests/worker-files/thread/testTaskFunctionObjectsWorker.mjs index 45f4f9f2..35cd6daf 100644 --- a/tests/worker-files/thread/testTaskFunctionObjectsWorker.mjs +++ b/tests/worker-files/thread/testTaskFunctionObjectsWorker.mjs @@ -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, } ) diff --git a/tests/worker-files/thread/testWorker.mjs b/tests/worker-files/thread/testWorker.mjs index f4840e53..67959837 100644 --- a/tests/worker-files/thread/testWorker.mjs +++ b/tests/worker-files/thread/testWorker.mjs @@ -15,5 +15,5 @@ function test (data) { export default new ThreadWorker(test, { killBehavior: KillBehaviors.HARD, - maxInactiveTime: 500 + maxInactiveTime: 500, }) diff --git a/tests/worker/abstract-worker.test.mjs b/tests/worker/abstract-worker.test.mjs index 79f85cdb..ed4fcbdb 100644 --- a/tests/worker/abstract-worker.test.mjs +++ b/tests/worker/abstract-worker.test.mjs @@ -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( diff --git a/tests/worker/cluster-worker.test.mjs b/tests/worker/cluster-worker.test.mjs index 70d63639..2ad79113 100644 --- a/tests/worker/cluster-worker.test.mjs +++ b/tests/worker/cluster-worker.test.mjs @@ -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) diff --git a/tests/worker/thread-worker.test.mjs b/tests/worker/thread-worker.test.mjs index 3151b90a..f78451f7 100644 --- a/tests/worker/thread-worker.test.mjs +++ b/tests/worker/thread-worker.test.mjs @@ -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 index 8fcf56d9..00000000 --- a/tsdoc.json +++ /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" - } - ] -} diff --git a/typedoc.mjs b/typedoc.mjs index 86f160da..cc33cb68 100644 --- a/typedoc.mjs +++ b/typedoc.mjs @@ -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) -- 2.34.1