X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Futils%2FFileUtils.ts;h=d1d5d629ab575ba7f5b238896eba114624271275;hb=da55bd34b987cea87c4fd1e508f3a24cee6f5418;hp=5e40b72435bc461b5ca8a6494ee08541be830a56;hpb=d972af76b6d7d1d2a099d254eacf45245b5316ac;p=e-mobility-charging-stations-simulator.git diff --git a/src/utils/FileUtils.ts b/src/utils/FileUtils.ts index 5e40b724..d1d5d629 100644 --- a/src/utils/FileUtils.ts +++ b/src/utils/FileUtils.ts @@ -2,7 +2,7 @@ import { type FSWatcher, type WatchListener, readFileSync, watch } from 'node:fs import { handleFileException } from './ErrorUtils'; import { logger } from './Logger'; -import { Utils } from './Utils'; +import { isNotEmptyString } from './Utils'; import type { FileType, JsonType } from '../types'; export const watchJsonFile = ( @@ -11,7 +11,7 @@ export const watchJsonFile = ( logPrefix: string, refreshedVariable?: T, listener: WatchListener = (event, filename) => { - if (Utils.isNotEmptyString(filename) && event === 'change') { + if (isNotEmptyString(filename) && event === 'change') { try { logger.debug(`${logPrefix} ${fileType} file ${file} have changed, reload`); refreshedVariable && (refreshedVariable = JSON.parse(readFileSync(file, 'utf8')) as T); @@ -23,7 +23,7 @@ export const watchJsonFile = ( } } ): FSWatcher | undefined => { - if (Utils.isNotEmptyString(file)) { + if (isNotEmptyString(file)) { try { return watch(file, listener); } catch (error) {