mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-19 01:35:18 -04:00
config/utils.ts: toBooleanConfig can return undefined
Signed-off-by: David Mehren <dmehren1@gmail.com>
This commit is contained in:
parent
943ddc4058
commit
3389a86689
1 changed files with 2 additions and 2 deletions
|
@ -1,11 +1,11 @@
|
||||||
import fs from 'fs'
|
import fs from 'fs'
|
||||||
import path from 'path'
|
import path from 'path'
|
||||||
|
|
||||||
export function toBooleanConfig (configValue: string | boolean | undefined): boolean {
|
export function toBooleanConfig (configValue: string | boolean | undefined): boolean | undefined {
|
||||||
if (typeof configValue === 'string') {
|
if (typeof configValue === 'string') {
|
||||||
return (configValue === 'true')
|
return (configValue === 'true')
|
||||||
}
|
}
|
||||||
return configValue || false
|
return configValue
|
||||||
}
|
}
|
||||||
|
|
||||||
export function toArrayConfig (configValue: string | undefined, separator = ',', fallback = []): any[] {
|
export function toArrayConfig (configValue: string | undefined, separator = ',', fallback = []): any[] {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue