From: Jérôme Benoit Date: Wed, 29 Nov 2023 20:28:06 +0000 (+0100) Subject: refactor: cleanup ElementsPerWorkerType type definition X-Git-Tag: v1.2.28~6 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=65a1157a0c0f0a7b23b7a6fc23432f2c3e7cb735;p=e-mobility-charging-stations-simulator.git refactor: cleanup ElementsPerWorkerType type definition Signed-off-by: Jérôme Benoit --- diff --git a/src/types/ConfigurationData.ts b/src/types/ConfigurationData.ts index df362b53..d1948921 100644 --- a/src/types/ConfigurationData.ts +++ b/src/types/ConfigurationData.ts @@ -64,12 +64,12 @@ export interface StorageConfiguration { uri?: string; } -export type elementsPerWorkerType = number | 'auto' | 'all'; +export type ElementsPerWorkerType = number | 'auto' | 'all'; export interface WorkerConfiguration { processType?: WorkerProcessType; startDelay?: number; - elementsPerWorker?: elementsPerWorkerType; + elementsPerWorker?: ElementsPerWorkerType; elementStartDelay?: number; poolMinSize?: number; poolMaxSize?: number; diff --git a/src/types/index.ts b/src/types/index.ts index a28d5114..a707b46b 100644 --- a/src/types/index.ts +++ b/src/types/index.ts @@ -167,6 +167,7 @@ export { ApplicationProtocolVersion, type ConfigurationData, ConfigurationSection, + type ElementsPerWorkerType, type LogConfiguration, type StationTemplateUrl, type StorageConfiguration, diff --git a/src/utils/ConfigurationUtils.ts b/src/utils/ConfigurationUtils.ts index 660bc764..73bd9ceb 100644 --- a/src/utils/ConfigurationUtils.ts +++ b/src/utils/ConfigurationUtils.ts @@ -5,8 +5,7 @@ import chalk from 'chalk'; import { Constants } from './Constants'; import { isNotEmptyString, logPrefix as utilsLogPrefix } from './Utils'; -import { FileType, StorageType } from '../types'; -import type { elementsPerWorkerType } from '../types/ConfigurationData'; +import { type ElementsPerWorkerType, FileType, StorageType } from '../types'; import { WorkerProcessType } from '../worker'; export const logPrefix = (): string => { @@ -69,7 +68,7 @@ export const checkWorkerProcessType = (workerProcessType: WorkerProcessType): vo }; export const checkWorkerElementsPerWorker = ( - elementsPerWorker: elementsPerWorkerType | undefined, + elementsPerWorker: ElementsPerWorkerType | undefined, ): void => { if ( elementsPerWorker !== undefined &&