Spaces:
Sleeping
Sleeping
Download src/lib/getValidString.ts from network01/ai-comic-factory: direct link, hf CLI and curl.
- Browser
- Download file 203 Bytes
-
https://huggingface.co/spaces/network01/ai-comic-factory/resolve/main/src/lib/getValidString.ts
- Command line
-
hf download hf://spaces/network01/ai-comic-factory/src/lib/getValidString.ts
-
curl -L -o getValidString.ts https://huggingface.co/spaces/network01/ai-comic-factory/resolve/main/src/lib/getValidString.ts
203 Bytes
| export function getValidString(something: any, defaultValue: string) { | |
| const strValue = `${something || defaultValue}` | |
| try { | |
| return JSON.parse(strValue) | |
| } catch (err) { | |
| return strValue | |
| } | |
| } |