MCPcopy
hub / github.com/prisma/prisma / parseEnvValue

Function parseEnvValue

packages/internals/src/utils/parseEnvValue.ts:11–28  ·  packages/internals/src/utils/parseEnvValue.ts::parseEnvValue
(object: EnvValue)

Source from the content-addressed store, hash-verified

9 * - If there is an env var is present but can't be resolved an error will be thrown
10 */
11export 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

Callers 12

getTestClientFunction · 0.90
setupTestSuiteClientFunction · 0.90
getProviderFunction · 0.90
extractPreviewFeaturesFunction · 0.90
getGeneratorsFunction · 0.90
formatOutputFunction · 0.90
generateMethod · 0.90
generator.test.tsFile · 0.90
getOutputPathFunction · 0.90
generator.test.tsFile · 0.90
parseMethod · 0.90
tryToReadDataFromSchemaFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected