Skip to content

Commit

Permalink
fix env refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
wkelly17 committed Nov 20, 2024
1 parent 86c9d6a commit 5e60739
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,9 @@ type getEnvArgs = {
export function getEnv({Astro, key}: getEnvArgs) {
if (Astro) {
return (
Astro.locals.runtime.env[key] || import.meta.env[key] || process.env[key]
Astro.locals?.runtime?.env[key] ||
import.meta.env[key] ||
process.env[key]
);
}
return import.meta.env[key] || process.env[key];
Expand Down

0 comments on commit 5e60739

Please sign in to comment.