Last active
July 22, 2024 08:46
-
-
Save euxn23/5c474611d78aab2ceb878042ecfb8e8e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| export function parseEnv(env: '1' | '0' | 'true' | 'false' | string | undefined): string | boolean { | |
| if (!env) { | |
| return false; | |
| } | |
| try { | |
| return Boolean(JSON.parse(env)); | |
| } catch { | |
| return env; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment