mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2024-11-22 09:46:30 -05:00
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
|
|
}
|