18 lines
597 B
JavaScript
18 lines
597 B
JavaScript
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
/**
|
|
* Read an environment variable.
|
|
*
|
|
* Trims beginning and trailing whitespace.
|
|
*
|
|
* Will return undefined if the environment variable doesn't exist or cannot be accessed.
|
|
*/
|
|
export const readEnv = (env) => {
|
|
if (typeof globalThis.process !== 'undefined') {
|
|
return globalThis.process.env?.[env]?.trim() ?? undefined;
|
|
}
|
|
if (typeof globalThis.Deno !== 'undefined') {
|
|
return globalThis.Deno.env?.get?.(env)?.trim();
|
|
}
|
|
return undefined;
|
|
};
|
|
//# sourceMappingURL=env.mjs.map
|