Spaces:
Sleeping
Sleeping
Download src/lib/getValidBoolean.ts from network01/ai-comic-factory: direct link, hf CLI and curl.
- Browser
- Download file 280 Bytes
-
https://huggingface.co/spaces/network01/ai-comic-factory/resolve/main/src/lib/getValidBoolean.ts
- Command line
-
hf download hf://spaces/network01/ai-comic-factory/src/lib/getValidBoolean.ts
-
curl -L -o getValidBoolean.ts https://huggingface.co/spaces/network01/ai-comic-factory/resolve/main/src/lib/getValidBoolean.ts
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" | |
| } |