mirror of
https://github.com/Instadapp/trustwallet-assets.git
synced 2024-07-29 22:37:31 +00:00
16 lines
467 B
TypeScript
16 lines
467 B
TypeScript
|
|
||
|
const configFileName = "../config.json";
|
||
|
const configData = require(configFileName);
|
||
|
|
||
|
export function getConfig(key: string, defaultValue: any): any {
|
||
|
if (!configData) {
|
||
|
console.log(`Missing config, config file: ${configFileName}`);
|
||
|
return defaultValue;
|
||
|
}
|
||
|
if (!(key in configData)) {
|
||
|
console.log(`Missing config entry, key ${key}, config file: ${configFileName}`);
|
||
|
return defaultValue;
|
||
|
}
|
||
|
return configData[key];
|
||
|
}
|