mirror of
https://gitlab.com/soapbox-pub/ditto.git
synced 2025-12-06 03:19:46 +00:00
8 lines
243 B
TypeScript
8 lines
243 B
TypeScript
import ISO6391 from 'iso-639-1';
|
|
import z from 'zod';
|
|
|
|
/** Value is a ISO-639-1 language code. */
|
|
export const languageSchema = z.string().refine(
|
|
(val) => ISO6391.validate(val),
|
|
{ message: 'Not a valid language in ISO-639-1 format' },
|
|
);
|