From ab80dc4621654ddd6f327ffec8db9a425e56e6d1 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Sat, 1 Jul 2023 19:29:20 +0200 Subject: [PATCH] docs: refine code documentation MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- src/utils.ts | 5 ++++- src/worker/abstract-worker.ts | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/utils.ts b/src/utils.ts index a6f5fbcc..87c4888d 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -32,7 +32,10 @@ export const DEFAULT_MEASUREMENT_STATISTICS_REQUIREMENTS: MeasurementStatisticsR } /** - * Safe helper to get the host OS optimized maximum pool size. + * 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 => { let availableParallelism = 1 diff --git a/src/worker/abstract-worker.ts b/src/worker/abstract-worker.ts index 25be4820..2a027269 100644 --- a/src/worker/abstract-worker.ts +++ b/src/worker/abstract-worker.ts @@ -202,7 +202,7 @@ export abstract class AbstractWorker< * Handles an error and convert it to a string so it can be sent back to the main worker. * * @param e - The error raised by the worker. - * @returns Message of the error. + * @returns The error message. */ protected handleError (e: Error | string): string { return e as string -- 2.34.1