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;
|
onValid?: (valid: R) => void;
|
||||||
},
|
},
|
||||||
): R extends undefined ? Fallback : R => {
|
): R extends undefined ? Fallback : R => {
|
||||||
let source = opts?.source ?? {};
|
const source = opts?.source ?? (typeof process !== "undefined" ? process?.env : {});
|
||||||
try {
|
|
||||||
source = process?.env ?? {};
|
|
||||||
} catch (e) {}
|
|
||||||
try {
|
try {
|
||||||
const c = envs[key];
|
const c = envs[key];
|
||||||
const g = source[c.key];
|
const g = source[c.key];
|
||||||
|
|||||||
Reference in New Issue
Block a user