5e5a021ce0
Signed-off-by: Alec WM <firstcontact@owls.io>
15 lines
448 B
JavaScript
15 lines
448 B
JavaScript
'use strict'
|
|
|
|
exports.toBooleanConfig = function toBooleanConfig (configValue) {
|
|
if (configValue && typeof configValue === 'string') {
|
|
return (configValue === 'true')
|
|
}
|
|
return configValue
|
|
}
|
|
|
|
exports.toArrayConfig = function toArrayConfig (configValue, separator = ',', fallback) {
|
|
if (configValue && typeof configValue === 'string') {
|
|
return (configValue.split(separator).map(arrayItem => arrayItem.trim()))
|
|
}
|
|
return fallback
|
|
}
|