Prettier reformat

This commit is contained in:
2023-05-20 21:29:27 -05:00
parent d9285647c2
commit 6e27447a99
18 changed files with 628 additions and 493 deletions

6
src/env/client.mjs vendored
View File

@@ -5,7 +5,7 @@ const _clientEnv = clientSchema.safeParse(clientEnv);
export const formatErrors = (
/** @type {import('zod').ZodFormattedError<Map<string,string>,string>} */
errors,
errors
) =>
Object.entries(errors)
.map(([name, value]) => {
@@ -17,7 +17,7 @@ export const formatErrors = (
if (!_clientEnv.success) {
console.error(
"❌ Invalid environment variables:\n",
...formatErrors(_clientEnv.error.format()),
...formatErrors(_clientEnv.error.format())
);
throw new Error("Invalid environment variables");
}
@@ -25,7 +25,7 @@ if (!_clientEnv.success) {
for (let key of Object.keys(_clientEnv.data)) {
if (!key.startsWith("NEXT_PUBLIC_")) {
console.warn(
`❌ Invalid public environment variable name: ${key}. It must begin with 'NEXT_PUBLIC_'`,
`❌ Invalid public environment variable name: ${key}. It must begin with 'NEXT_PUBLIC_'`
);
throw new Error("Invalid public environment variable name");

2
src/env/server.mjs vendored
View File

@@ -11,7 +11,7 @@ const _serverEnv = serverSchema.safeParse(serverEnv);
if (!_serverEnv.success) {
console.error(
"❌ Invalid environment variables:\n",
...formatErrors(_serverEnv.error.format()),
...formatErrors(_serverEnv.error.format())
);
throw new Error("Invalid environment variables");
}