From 08b58f0020986c0ad1b55e562aaf325a47b9d58c Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Sun, 30 Jul 2023 18:19:24 +0200 Subject: [PATCH] refactor: rename src/charging-station/Utils.ts -> src/charging-station/Helpers.ts MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- .../AutomaticTransactionGenerator.ts | 2 +- src/charging-station/Bootstrap.ts | 2 +- src/charging-station/ChargingStation.ts | 30 +++++++++---------- src/charging-station/{Utils.ts => Helpers.ts} | 2 +- src/charging-station/IdTagsCache.ts | 2 +- src/charging-station/index.ts | 2 +- 6 files changed, 20 insertions(+), 20 deletions(-) rename src/charging-station/{Utils.ts => Helpers.ts} (99%) diff --git a/src/charging-station/AutomaticTransactionGenerator.ts b/src/charging-station/AutomaticTransactionGenerator.ts index 5e11f36e..bdeffbd2 100644 --- a/src/charging-station/AutomaticTransactionGenerator.ts +++ b/src/charging-station/AutomaticTransactionGenerator.ts @@ -5,8 +5,8 @@ import { AsyncResource } from 'node:async_hooks'; import { hoursToMilliseconds, secondsToMilliseconds } from 'date-fns'; import type { ChargingStation } from './ChargingStation'; +import { checkChargingStation } from './Helpers'; import { IdTagsCache } from './IdTagsCache'; -import { checkChargingStation } from './Utils'; import { BaseError } from '../exception'; import { PerformanceStatistics } from '../performance'; import { diff --git a/src/charging-station/Bootstrap.ts b/src/charging-station/Bootstrap.ts index 7e23949c..27f4a607 100644 --- a/src/charging-station/Bootstrap.ts +++ b/src/charging-station/Bootstrap.ts @@ -8,9 +8,9 @@ import { isMainThread } from 'node:worker_threads'; import chalk from 'chalk'; import { availableParallelism } from 'poolifier'; +import { waitChargingStationEvents } from './Helpers'; import type { AbstractUIServer } from './ui-server/AbstractUIServer'; import { UIServerFactory } from './ui-server/UIServerFactory'; -import { waitChargingStationEvents } from './Utils'; import { version } from '../../package.json' assert { type: 'json' }; import { BaseError } from '../exception'; import { type Storage, StorageFactory } from '../performance'; diff --git a/src/charging-station/ChargingStation.ts b/src/charging-station/ChargingStation.ts index bf5bc189..c379ec7b 100644 --- a/src/charging-station/ChargingStation.ts +++ b/src/charging-station/ChargingStation.ts @@ -26,20 +26,6 @@ import { getConfigurationKey, setConfigurationKeyValue, } from './ConfigurationKeyUtils'; -import { IdTagsCache } from './IdTagsCache'; -import { - OCPP16IncomingRequestService, - OCPP16RequestService, - OCPP16ResponseService, - OCPP16ServiceUtils, - OCPP20IncomingRequestService, - OCPP20RequestService, - OCPP20ResponseService, - type OCPPIncomingRequestService, - type OCPPRequestService, - OCPPServiceUtils, -} from './ocpp'; -import { SharedLRUCache } from './SharedLRUCache'; import { buildConnectorsMap, checkConnectorsConfiguration, @@ -62,7 +48,21 @@ import { propagateSerialNumber, stationTemplateToStationInfo, warnTemplateKeysDeprecation, -} from './Utils'; +} from './Helpers'; +import { IdTagsCache } from './IdTagsCache'; +import { + OCPP16IncomingRequestService, + OCPP16RequestService, + OCPP16ResponseService, + OCPP16ServiceUtils, + OCPP20IncomingRequestService, + OCPP20RequestService, + OCPP20ResponseService, + type OCPPIncomingRequestService, + type OCPPRequestService, + OCPPServiceUtils, +} from './ocpp'; +import { SharedLRUCache } from './SharedLRUCache'; import { BaseError, OCPPError } from '../exception'; import { PerformanceStatistics } from '../performance'; import { diff --git a/src/charging-station/Utils.ts b/src/charging-station/Helpers.ts similarity index 99% rename from src/charging-station/Utils.ts rename to src/charging-station/Helpers.ts index fa60c9a5..7f32b487 100644 --- a/src/charging-station/Utils.ts +++ b/src/charging-station/Helpers.ts @@ -65,7 +65,7 @@ import { secureRandom, } from '../utils'; -const moduleName = 'Utils'; +const moduleName = 'Helpers'; export const getChargingStationId = ( index: number, diff --git a/src/charging-station/IdTagsCache.ts b/src/charging-station/IdTagsCache.ts index e88a3a5d..5e0ab0b8 100644 --- a/src/charging-station/IdTagsCache.ts +++ b/src/charging-station/IdTagsCache.ts @@ -1,7 +1,7 @@ import { type FSWatcher, readFileSync } from 'node:fs'; import type { ChargingStation } from './ChargingStation'; -import { getIdTagsFile } from './Utils'; +import { getIdTagsFile } from './Helpers'; import { FileType, IdTagDistribution } from '../types'; import { handleFileException, diff --git a/src/charging-station/index.ts b/src/charging-station/index.ts index 32417cb2..0d15d676 100644 --- a/src/charging-station/index.ts +++ b/src/charging-station/index.ts @@ -10,4 +10,4 @@ export { checkChargingStation, resetConnectorStatus, hasFeatureProfile, -} from './Utils'; +} from './Helpers'; -- 2.34.1