2025-02-12 23:04:44 +01:00
|
|
|
import ISO6391 from "iso-639-1";
|
2025-07-07 03:42:35 +02:00
|
|
|
import { z } from "zod/v4";
|
2025-02-05 22:49:07 +01:00
|
|
|
|
2025-07-07 03:42:35 +02:00
|
|
|
export const Id = z.uuid();
|
2025-02-12 23:04:44 +01:00
|
|
|
|
2025-03-24 15:25:40 +01:00
|
|
|
export const iso631 = z
|
|
|
|
|
.enum(ISO6391.getAllCodes() as [string, ...string[]])
|
2025-07-07 03:42:35 +02:00
|
|
|
.meta({
|
2025-03-29 03:30:06 +01:00
|
|
|
description: "ISO 639-1 language code",
|
|
|
|
|
example: "en",
|
|
|
|
|
externalDocs: {
|
|
|
|
|
url: "https://en.wikipedia.org/wiki/List_of_ISO_639-1_language_codes",
|
|
|
|
|
},
|
2025-07-07 03:42:35 +02:00
|
|
|
id: "ISO631",
|
2025-03-29 03:30:06 +01:00
|
|
|
});
|
2025-02-15 02:47:29 +01:00
|
|
|
|
2025-07-07 03:42:35 +02:00
|
|
|
export const zBoolean = z.stringbool().or(z.boolean());
|