config/utils.ts: toBooleanConfig can return undefined

Signed-off-by: David Mehren <dmehren1@gmail.com>
This commit is contained in:
David Mehren 2020-04-12 17:43:41 +02:00
parent 943ddc4058
commit 3389a86689
No known key found for this signature in database
GPG key ID: 6017AF117F9756CB

View file

@ -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[] {