ai-comic-factory / src /lib /getValidBoolean.ts
jbilcke-hf's picture
jbilcke-hf HF staff
add new turbo mode
4f8f050
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"
}