mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2024-11-21 17:26:29 -05:00
fix: extend parsing of boolean environment vars
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
This commit is contained in:
parent
29b3562672
commit
e2b84e134a
2 changed files with 11 additions and 1 deletions
|
@ -3,9 +3,14 @@
|
|||
const fs = require('fs')
|
||||
const path = require('path')
|
||||
|
||||
function isPositiveAnswer (value) {
|
||||
const lowerValue = value.toLowerCase()
|
||||
return lowerValue === 'yes' || lowerValue === '1' || lowerValue === 'true'
|
||||
}
|
||||
|
||||
exports.toBooleanConfig = function toBooleanConfig (configValue) {
|
||||
if (configValue && typeof configValue === 'string') {
|
||||
return (configValue === 'true')
|
||||
return (isPositiveAnswer(configValue))
|
||||
}
|
||||
return configValue
|
||||
}
|
||||
|
|
|
@ -1,5 +1,10 @@
|
|||
# Release Notes
|
||||
|
||||
## UNRELEASED
|
||||
|
||||
### Enhancements
|
||||
- Extend boolean environment variable parsing with other positive answers and case insensitivity.
|
||||
|
||||
## <i class="fa fa-tag"></i> 1.9.7 <i class="fa fa-calendar-o"></i> 2023-02-19
|
||||
|
||||
### Bugfixes
|
||||
|
|
Loading…
Reference in a new issue