4
1
mirror of https://github.com/Qortal/qortal-ui.git synced 2025-02-11 17:55:51 +00:00
qortal-ui/core/config/load-config.js

22 lines
466 B
JavaScript
Raw Normal View History

2021-12-25 14:39:47 +01:00
let config = require('./config.js')
const checkKeys = (storeObj, newObj) => {
for (const key in newObj) {
if (!Object.prototype.hasOwnProperty.call(storeObj, key)) return
2021-12-25 14:39:47 +01:00
if (typeof newObj[key] === 'object') {
storeObj[key] = checkKeys(storeObj[key], newObj[key])
} else {
storeObj[key] = newObj[key]
}
}
return storeObj
2021-12-25 14:39:47 +01:00
}
const getConfig = customConfig => {
config = checkKeys(config, customConfig)
return config
2021-12-25 14:39:47 +01:00
}
module.exports = getConfig