ai-comic-factory / src /lib /getValidString.ts
jbilcke-hf's picture
jbilcke-hf HF staff
working to fix the config
a296341
raw
history blame
No virus
203 Bytes
export function getValidString(something: any, defaultValue: string) {
const strValue = `${something || defaultValue}`
try {
return JSON.parse(strValue)
} catch (err) {
return strValue
}
}