refactor: upgrade to Zod v4 (#623)

This commit is contained in:
Elias Schneider
2025-06-08 15:44:59 +02:00
committed by GitHub
parent 9a4aab465a
commit 388a874922
18 changed files with 270 additions and 51 deletions

View File

@@ -0,0 +1,10 @@
import { setLocale as setParaglideLocale, type Locale } from '$lib/paraglide/runtime';
import { z } from 'zod/v4';
export function setLocale(locale: Locale, reload = true) {
import(`../../../node_modules/zod/dist/esm/v4/locales/${locale}.js`)
.then((zodLocale) => z.config(zodLocale.default()))
.finally(() => {
setParaglideLocale(locale, { reload });
});
}