[addon] adds custom landing page for addon configuration

This commit is contained in:
TheBeastLT
2020-03-15 20:37:30 +01:00
parent dba04c8a69
commit a1d39af630
7 changed files with 341 additions and 18 deletions

View File

@@ -0,0 +1,16 @@
function parseConfiguration(configuration) {
const configValues = configuration.split('|')
.reduce((map, next) => {
const parameterParts = next.split('=');
if (parameterParts.length === 2) {
map[parameterParts[0].toLowerCase()] = parameterParts[1];
}
return map;
}, {});
if (configValues.providers) {
configValues.providers = configValues.providers.split(',').map(provider => provider.toLowerCase());
}
return configValues;
}
module.exports = parseConfiguration;