mirror of
https://github.com/versia-pub/server.git
synced 2025-12-06 08:28:19 +01:00
18 lines
458 B
TypeScript
18 lines
458 B
TypeScript
import ISO6391 from "iso-639-1";
|
|
import { z } from "zod";
|
|
|
|
export const Id = z.uuid();
|
|
|
|
export const iso631 = z
|
|
.enum(ISO6391.getAllCodes() as [string, ...string[]])
|
|
.meta({
|
|
description: "ISO 639-1 language code",
|
|
example: "en",
|
|
externalDocs: {
|
|
url: "https://en.wikipedia.org/wiki/List_of_ISO_639-1_language_codes",
|
|
},
|
|
id: "ISO631",
|
|
});
|
|
|
|
export const zBoolean = z.stringbool().or(z.boolean());
|