mirror of
https://github.com/ReaJason/MemShellParty.git
synced 2026-09-23 23:41:52 +08:00
refactor: enhance web ux
This commit is contained in:
+6
-2
@@ -2,16 +2,20 @@ import * as z from "zod";
|
||||
|
||||
const EnvSchema = z.object({
|
||||
API_URL: z.optional(z.string()),
|
||||
MODE: z.string(),
|
||||
});
|
||||
|
||||
const createEnv = () => {
|
||||
// @ts-ignore
|
||||
const envVars = Object.entries(import.meta.env).reduce<Record<string, string>>((acc, curr) => {
|
||||
const [key, value] = curr;
|
||||
if (key.startsWith("VITE_APP_")) {
|
||||
if (typeof value === "string") {
|
||||
if (typeof value === "string") {
|
||||
if (key.startsWith("VITE_APP_")) {
|
||||
acc[key.replace("VITE_APP_", "")] = value;
|
||||
}
|
||||
if (key === "MODE") {
|
||||
acc[key] = value;
|
||||
}
|
||||
}
|
||||
return acc;
|
||||
}, {});
|
||||
|
||||
Reference in New Issue
Block a user