(object: EnvValue)
| 9 | * - If there is an env var is present but can't be resolved an error will be thrown |
| 10 | */ |
| 11 | export function parseEnvValue(object: EnvValue) { |
| 12 | if (object.fromEnvVar && object.fromEnvVar != class="st">'null') { |
| 13 | const value = process.env[object.fromEnvVar] |
| 14 | if (!value) { |
| 15 | throw new Error( |
| 16 | `Attempted to load provider value using \`env(${ |
| 17 | object.fromEnvVar |
| 18 | })\` but it was not present. Please ensure that ${dim( |
| 19 | object.fromEnvVar, |
| 20 | )} is present in your Environment Variables`, |
| 21 | ) |
| 22 | } |
| 23 | |
| 24 | return value |
| 25 | } |
| 26 | |
| 27 | return object.value as string |
| 28 | } |
| 29 | |
| 30 | /** |
| 31 | * Parses the BinaryTargetsEnvValue and return the string value |
no outgoing calls
no test coverage detected