Qortal UI - Main Code Repository A User Interface for the Qortal Blockchain Project. Truly decentralized web hosting, application hosting, communications, data storage, and full infrastructure for the future global decentralized digital world.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

33 lines
642 B

3 years ago
let config = require('./default.config.js')
3 years ago
let userConfig = {}
3 years ago
try {
userConfig = require('./customConfig.js')
3 years ago
} catch (e) {
console.warn(e)
console.warn('Error loading user config')
3 years ago
}
3 years ago
const checkKeys = (storeObj, newObj) => {
for (const key in newObj) {
if (!Object.prototype.hasOwnProperty.call(storeObj, key)) {
return
}
if (typeof newObj[key] === 'object') {
storeObj[key] = checkKeys(storeObj[key], newObj[key])
} else {
storeObj[key] = newObj[key]
}
}
3 years ago
return storeObj
3 years ago
}
const getConfig = customConfig => {
config = checkKeys(config, customConfig)
return config
3 years ago
}
module.exports = getConfig(userConfig)