mirror of
https://github.com/hamster1963/nezha-dash.git
synced 2025-04-24 21:10:45 +08:00
refactor: modify getEnv to return undefined for non-existent environment variables
This commit is contained in:
parent
d775cde3ca
commit
4da2eca1c1
@ -1,7 +1,7 @@
|
||||
import { getClientEnv, getServerEnv } from "./env"
|
||||
import type { EnvKey } from "./env"
|
||||
|
||||
export default function getEnv(key: EnvKey): string {
|
||||
export default function getEnv(key: EnvKey): string | undefined {
|
||||
if (key.startsWith("NEXT_PUBLIC_")) {
|
||||
const clientKey = key.replace("NEXT_PUBLIC_", "") as any
|
||||
return getClientEnv(clientKey)
|
||||
|
Loading…
Reference in New Issue
Block a user