ai-comic-factory / src /lib /getValidString.ts
jbilcke-hf's picture
jbilcke-hf HF staff
we now have.. custom models β˜„οΈ.. and settings ✨
11d758a
raw
history blame
223 Bytes
export function getValidString(something: any, defaultValue: string) {
const strValue = `${something || defaultValue}`
try {
return JSON.parse(strValue) || defaultValue
} catch (err) {
return defaultValue
}
}