Files
website/src/lib/validation/blog.ts
Stan Runge eca43c82d0
Some checks failed
Test and deploy staging / staging (push) Failing after 1m39s
fix zod imports in bun test build
2026-09-23 04:47:27 +00:00

24 lines
491 B
TypeScript

import * as z from 'zod';
export const createArticleSchema = z.object({
title: z.string().min(1).max(256)
});
export const updateArticleSchema = z.object({
title: z.string().min(1).max(256),
slug: z.string().min(1).max(120),
content: z.string().max(50000),
tags: z.array(z.string().min(1).max(32)).max(8)
});
export function parseArticleTags(value: string) {
return [
...new Set(
value
.split(',')
.map((tag) => tag.trim().toLowerCase())
.filter(Boolean)
)
];
}