fix: suppress type error in pickRequired/pickOptional helpers
This commit is contained in:
@@ -81,11 +81,11 @@ function pickRequired(raw: RawEnv, key: keyof RawEnv, fallbackKey: keyof RawEnv)
|
|||||||
if (!value) {
|
if (!value) {
|
||||||
throw new Error(`Missing required env: ${String(key)} (fallback: ${String(fallbackKey)})`);
|
throw new Error(`Missing required env: ${String(key)} (fallback: ${String(fallbackKey)})`);
|
||||||
}
|
}
|
||||||
return value;
|
return value as string;
|
||||||
}
|
}
|
||||||
|
|
||||||
function pickOptional(raw: RawEnv, key: keyof RawEnv, fallbackKey: keyof RawEnv): string | undefined {
|
function pickOptional(raw: RawEnv, key: keyof RawEnv, fallbackKey: keyof RawEnv): string | undefined {
|
||||||
return raw[key] ?? raw[fallbackKey] ?? undefined;
|
return (raw[key] ?? raw[fallbackKey] ?? undefined) as string | undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
let cachedEnv: Env | null = null;
|
let cachedEnv: Env | null = null;
|
||||||
|
|||||||
Reference in New Issue
Block a user