@lucidcms/core
Version:
The core of the Lucid CMS. It's responsible for spinning up the API and serving the CMS.
1 lines • 964 B
Source Map (JSON)
{"version":3,"file":"validate-env-vars.mjs","names":[],"sources":["../../../../src/libs/cli/services/validate-env-vars.ts"],"sourcesContent":["import type { ZodType } from \"zod\";\nimport cliLogger from \"../logger.js\";\n\n/**\n * Validates the environment variables against the schema if present\n */\nconst validateEnvVars = async (props: {\n\tenvSchema: ZodType | undefined;\n\tenv: Record<string, unknown> | undefined;\n}): Promise<boolean> => {\n\tconst { envSchema, env } = props;\n\n\tif (!envSchema || !env) {\n\t\treturn true;\n\t}\n\n\ttry {\n\t\tenvSchema.parse(env);\n\t\treturn true;\n\t} catch (error) {\n\t\tif (error instanceof Error) cliLogger.errorInstance(error);\n\n\t\treturn false;\n\t}\n};\n\nexport default validateEnvVars;\n"],"mappings":"6BAMA,MAAM,EAAkB,KAAO,IAGP,CACvB,GAAM,CAAE,YAAW,OAAQ,EAE3B,GAAI,CAAC,GAAa,CAAC,EAClB,MAAO,GAGR,GAAI,CAEH,OADA,EAAU,MAAM,CAAG,EACZ,EACR,OAAS,EAAO,CAGf,OAFI,aAAiB,OAAO,EAAU,cAAc,CAAK,EAElD,EACR,CACD"}