refactor: code cleanup
authorJérôme Benoit <jerome.benoit@piment-noir.org>
Sun, 3 Sep 2023 09:21:06 +0000 (11:21 +0200)
committerJérôme Benoit <jerome.benoit@piment-noir.org>
Sun, 3 Sep 2023 09:21:06 +0000 (11:21 +0200)
Signed-off-by: Jérôme Benoit <jerome.benoit@piment-noir.org>
src/utils.ts

index e1d6c11859936dfef95d5e4777e509ca50df5f0f..e864a015f09f40da811245564fac3d36eee760bf 100644 (file)
@@ -74,9 +74,7 @@ export const availableParallelism = (): number => {
  * @returns The worker type of the given worker.
  * @internal
  */
-export const getWorkerType = <Worker extends IWorker>(
-  worker: Worker
-): WorkerType | undefined => {
+export const getWorkerType = (worker: IWorker): WorkerType | undefined => {
   if (worker instanceof ThreadWorker) {
     return WorkerTypes.thread
   } else if (worker instanceof ClusterWorker) {
@@ -91,9 +89,7 @@ export const getWorkerType = <Worker extends IWorker>(
  * @returns The worker id of the given worker.
  * @internal
  */
-export const getWorkerId = <Worker extends IWorker>(
-  worker: Worker
-): number | undefined => {
+export const getWorkerId = (worker: IWorker): number | undefined => {
   if (worker instanceof ThreadWorker) {
     return worker.threadId
   } else if (worker instanceof ClusterWorker) {