2021-12-25 14:39:47 +01:00
|
|
|
let config = require('./config.js')
|
|
|
|
|
|
|
|
const checkKeys = (storeObj, newObj) => {
|
2024-05-08 13:16:23 +02:00
|
|
|
for (const key in newObj) {
|
|
|
|
if (!Object.prototype.hasOwnProperty.call(storeObj, key)) return
|
2021-12-25 14:39:47 +01:00
|
|
|
|
2024-05-08 13:16:23 +02: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 => {
|
2024-05-08 13:16:23 +02:00
|
|
|
config = checkKeys(config, customConfig)
|
|
|
|
return config
|
2021-12-25 14:39:47 +01:00
|
|
|
}
|
|
|
|
|
2024-05-08 13:16:23 +02:00
|
|
|
module.exports = getConfig
|