workflow-comics / src /lib /getValidBoolean.ts
zanekwok's picture
init
450060f
raw
history blame
280 Bytes
export const getValidBoolean = (something: any, defaultValue: boolean) => {
if (typeof something === "boolean") {
return something
}
const strValue = `${something || defaultValue}`.toLowerCase()
return strValue === "true" || strValue === "1" || strValue === "on"
}