+ Configuration.deprecateConfigurationKey('distributeStationToTenantEqually', 'Use \'distributeStationsToTenantsEqually\' instead');
+ return Configuration.objectHasOwnProperty(Configuration.getConfig(), 'distributeStationsToTenantsEqually') ? Configuration.getConfig().distributeStationsToTenantsEqually : true;
+ }
+
+ private static deprecateConfigurationKey(key: string, logMsgToAppend = '') {
+ if (!Configuration.isUndefined(Configuration.getConfig()[key])) {
+ console.error(`Deprecated configuration key '${key}' usage${logMsgToAppend && '. ' + logMsgToAppend}`);
+ }
+ }
+
+ // Read the config file
+ private static getConfig(): ConfigurationData {
+ if (!Configuration.configuration) {
+ Configuration.configuration = JSON.parse(fs.readFileSync('./src/assets/config.json', 'utf8')) as ConfigurationData;
+ }
+ return Configuration.configuration;
+ }
+
+ private static objectHasOwnProperty(object: any, property: string): boolean {
+ return Object.prototype.hasOwnProperty.call(object, property) as boolean;
+ }
+
+ private static isUndefined(obj: any): boolean {
+ return typeof obj === 'undefined';