mirror of
https://github.com/bknd-io/bknd/
synced 2026-08-02 08:06:00 +00:00
fix env test, prefer source over process
This commit is contained in:
+2
-4
@@ -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];
|
||||
|
||||
Reference in New Issue
Block a user