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