feat: set supervision url through the UI protocol
[e-mobility-charging-stations-simulator.git] / src / charging-station / AuthorizedTagsCache.ts
index b5058291b71c1a336ce914786d94f6a90af2e80f..332b3a983a8b8760ef33668639ec09b3aaf24d9c 100644 (file)
@@ -1,11 +1,9 @@
 import fs from 'node:fs';
 
-import { FileType } from '../types/FileType';
-import FileUtils from '../utils/FileUtils';
-import logger from '../utils/Logger';
-import Utils from '../utils/Utils';
+import { FileType } from '../types';
+import { FileUtils, Utils, logger } from '../utils';
 
-export default class AuthorizedTagsCache {
+export class AuthorizedTagsCache {
   private static instance: AuthorizedTagsCache | null = null;
   private readonly tagsCaches: Map<string, string[]>;
   private readonly FSWatchers: Map<string, fs.FSWatcher | undefined>;
@@ -35,7 +33,7 @@ export default class AuthorizedTagsCache {
             this.logPrefix(file),
             undefined,
             (event, filename) => {
-              if (!Utils.isEmptyString(filename) && event === 'change') {
+              if (Utils.isNotEmptyString(filename) && event === 'change') {
                 try {
                   logger.debug(
                     `${this.logPrefix(file)} ${FileType.Authorization} file have changed, reload`
@@ -106,7 +104,7 @@ export default class AuthorizedTagsCache {
     return authorizedTags;
   }
 
-  private logPrefix(file: string): string {
+  private logPrefix = (file: string): string => {
     return Utils.logPrefix(` Authorized tags cache for authorization file '${file}' |`);
-  }
+  };
 }