MCPcopy Create free account
hub / github.com/boringstack-xyz/boringstack / formatSchemaErrors

Function formatSchemaErrors

apps/api/src/config/env/validate.ts:805–816  ·  view source on GitHub ↗
(raw: Record<string, unknown>)

Source from the content-addressed store, hash-verified

803];
804
805const formatSchemaErrors = (raw: Record<string, unknown>): string[] => {
806 const errors: string[] = [];
807
808 for (const error of Value.Errors(envSchema, raw)) {
809 const stripped = error.path.replace(/^\//, "");
810 const key = stripped === "" ? "<root>" : stripped;
811
812 errors.push(`${key}: ${error.message}`);
813 }
814
815 return errors;
816};
817
818export const validateEnv = (source: EnvSource = process.env): Env => {
819 const raw = readRaw(source);

Callers 1

validateEnvFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected