From 8d1e85d4ea909c2b6e62126f97fc1c8b945eed6c Mon Sep 17 00:00:00 2001 From: Maykon Oliveira Date: Tue, 16 Jan 2024 17:14:05 -0300 Subject: [PATCH] chore: README update Improve documentation to explain how to reuse a configured Zod instance between different schema files. --- README.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/README.md b/README.md index 8f3b093..947542b 100644 --- a/README.md +++ b/README.md @@ -34,6 +34,15 @@ i18next.init({ }); z.setErrorMap(zodI18nMap); +// export configured zod instance +export { z } +``` + +Import wherever it's required + +```ts +import { z } from "./es-zod"; + const schema = z.string().email(); // Translated into Spanish (es) schema.parse("foo"); // => correo inválido