File: D:/HostingSpaces/SBogers10/douven.komma.pro/resources/assets/ts/services/core/ConfigService.ts
import * as core from '../../config/core.json'
export class ConfigService {
constructor()
{
}
public static get(key:string): string
{
let configKeyComponents = key.split('.');
if(configKeyComponents.length < 2) {
console.error("Config key '"+key+"' must at least have one . separating a configuration file from a configuration value. Ignoring the key by returning an empty string");
return '';
}
let file:string = configKeyComponents[0];
let option:string = configKeyComponents[1];
switch (file)
{
case 'core':
if(core.hasOwnProperty(option)) return core[option];
break
}
console.warn("Config key '"+key+"' did not exist.");
return '';
}
}