[addon] adds custom landing page for addon configuration
This commit is contained in:
16
addon/lib/configuration.js
Normal file
16
addon/lib/configuration.js
Normal 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;
|
||||
Reference in New Issue
Block a user