mirror of
https://github.com/aljazceru/ditto.git
synced 2026-02-23 14:06:58 +01:00
refactor(languageSchema): enforce return type
This commit is contained in:
@@ -41,7 +41,7 @@ const fileSchema = z.custom<File>((value) => value instanceof File);
|
||||
|
||||
const percentageSchema = z.coerce.number().int().gte(1).lte(100);
|
||||
|
||||
const languageSchema = z.string().transform((val, ctx) => {
|
||||
const languageSchema = z.string().transform<LanguageCode>((val, ctx) => {
|
||||
val = (val.toLowerCase()).split('-')[0]; // pt-BR -> pt
|
||||
if (!ISO6391.validate(val)) {
|
||||
ctx.addIssue({
|
||||
|
||||
Reference in New Issue
Block a user