Skip to content

zod-envkit


formatZodError(err): string

Defined in: index.ts:128

Format ZodError into a human-friendly multi-line message (one issue per line).

Output format (stable in 1.x): path: message

Parameters

err

ZodError

Returns

string

Example

ts
const result = loadEnv(EnvSchema);
if (!result.ok) console.error(formatZodError(result.error));

Since

1.0.0

Released under the MIT License.