X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Futils%2FConfigurationUtils.ts;h=73bd9ceb8dbf4124ad34ed8962c94493f75be671;hb=de7b9e0583275225509c099f75a2801371da54d0;hp=eb992cadfa8ad5db3463ea5b9bc0796ad6a30b21;hpb=4354af5acc068587187dbe3729a5ca8d54fb9626;p=e-mobility-charging-stations-simulator.git diff --git a/src/utils/ConfigurationUtils.ts b/src/utils/ConfigurationUtils.ts index eb992cad..73bd9ceb 100644 --- a/src/utils/ConfigurationUtils.ts +++ b/src/utils/ConfigurationUtils.ts @@ -5,7 +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, FileType, StorageType } from '../types'; import { WorkerProcessType } from '../worker'; export const logPrefix = (): string => { @@ -68,12 +68,12 @@ export const checkWorkerProcessType = (workerProcessType: WorkerProcessType): vo }; export const checkWorkerElementsPerWorker = ( - elementsPerWorker: number | 'auto' | 'single' | undefined, + elementsPerWorker: ElementsPerWorkerType | undefined, ): void => { if ( elementsPerWorker !== undefined && elementsPerWorker !== 'auto' && - elementsPerWorker !== 'single' && + elementsPerWorker !== 'all' && !Number.isSafeInteger(elementsPerWorker) ) { throw new SyntaxError(