removed excess comments
This commit is contained in:
4
src/env/client.ts
vendored
4
src/env/client.ts
vendored
@@ -1,7 +1,6 @@
|
||||
import { z } from "zod";
|
||||
|
||||
const clientEnvSchema = z.object({
|
||||
// Client-side environment variables (VITE_ prefixed)
|
||||
VITE_DOMAIN: z.string().min(1),
|
||||
VITE_AWS_BUCKET_STRING: z.string().min(1),
|
||||
VITE_GOOGLE_CLIENT_ID: z.string().min(1),
|
||||
@@ -11,10 +10,8 @@ const clientEnvSchema = z.object({
|
||||
VITE_INFILL_ENDPOINT: z.string().min(1)
|
||||
});
|
||||
|
||||
// Type inference
|
||||
export type ClientEnv = z.infer<typeof clientEnvSchema>;
|
||||
|
||||
// Validation function for client-side with detailed error messages
|
||||
export const validateClientEnv = (
|
||||
envVars: Record<string, string | undefined>
|
||||
): ClientEnv => {
|
||||
@@ -70,7 +67,6 @@ export const validateClientEnv = (
|
||||
}
|
||||
};
|
||||
|
||||
// Validate and export environment variables directly
|
||||
const validateAndExportEnv = (): ClientEnv => {
|
||||
try {
|
||||
const validated = validateClientEnv(import.meta.env);
|
||||
|
||||
4
src/env/server.ts
vendored
4
src/env/server.ts
vendored
@@ -1,7 +1,6 @@
|
||||
import { z } from "zod";
|
||||
|
||||
const serverEnvSchema = z.object({
|
||||
// Server-side environment variables
|
||||
NODE_ENV: z.enum(["development", "test", "production"]),
|
||||
ADMIN_EMAIL: z.string().min(1),
|
||||
ADMIN_ID: z.string().min(1),
|
||||
@@ -35,10 +34,8 @@ const serverEnvSchema = z.object({
|
||||
INFILL_BEARER_TOKEN: z.string().min(1)
|
||||
});
|
||||
|
||||
// Type inference
|
||||
export type ServerEnv = z.infer<typeof serverEnvSchema>;
|
||||
|
||||
// Validation function for server-side with detailed error messages
|
||||
export const validateServerEnv = (
|
||||
envVars: Record<string, string | undefined>
|
||||
): ServerEnv => {
|
||||
@@ -91,7 +88,6 @@ export const validateServerEnv = (
|
||||
}
|
||||
};
|
||||
|
||||
// Validate and export environment variables directly
|
||||
const validateAndExportEnv = (): ServerEnv => {
|
||||
try {
|
||||
const validated = validateServerEnv(process.env);
|
||||
|
||||
Reference in New Issue
Block a user