mirror of
https://github.com/Sendouc/sendou.ink.git
synced 2026-09-27 21:58:08 -05:00
15 lines
352 B
TypeScript
15 lines
352 B
TypeScript
import * as v from "valibot";
|
|
|
|
const authorName = v.pipe(v.string(), v.minLength(1));
|
|
|
|
const author = v.union([
|
|
authorName,
|
|
v.object({ name: authorName, link: v.pipe(v.string(), v.url()) }),
|
|
]);
|
|
|
|
export const articleDataSchema = v.object({
|
|
title: v.pipe(v.string(), v.minLength(1)),
|
|
author: v.union([author, v.array(author)]),
|
|
date: v.date(),
|
|
});
|