mirror of
https://github.com/renovatebot/renovate.git
synced 2025-01-12 15:06:27 +00:00
29 lines
499 B
JavaScript
29 lines
499 B
JavaScript
const configDefinitions = require('./definitions');
|
|
|
|
module.exports = {
|
|
getDefault,
|
|
getConfig,
|
|
};
|
|
|
|
const defaultValues = {
|
|
boolean: true,
|
|
list: [],
|
|
string: null,
|
|
};
|
|
|
|
function getDefault(option) {
|
|
return option.default === undefined
|
|
? defaultValues[option.type]
|
|
: option.default;
|
|
}
|
|
|
|
function getConfig() {
|
|
const options = configDefinitions.getOptions();
|
|
const config = {};
|
|
|
|
options.forEach(option => {
|
|
config[option.name] = getDefault(option);
|
|
});
|
|
|
|
return config;
|
|
}
|