fix env test, prefer source over process

This commit is contained in:
dswbx
2025-11-11 14:02:43 +01:00
parent 4859b99954
commit 8c26d646bd
+2 -4
View File
@@ -73,10 +73,8 @@ export const env = <
onValid?: (valid: R) => void;
},
): R extends undefined ? Fallback : R => {
let source = opts?.source ?? {};
try {
source = process?.env ?? {};
} catch (e) {}
const source = opts?.source ?? (typeof process !== "undefined" ? process?.env : {});
try {
const c = envs[key];
const g = source[c.key];