Files
warren/frontend/lib/schemas/share.ts
2025-08-29 15:32:23 +02:00

13 lines
331 B
TypeScript

import { number, object, string } from 'yup';
export const shareSchema = object({
password: string()
.trim()
.transform((s: string) => (s.length > 0 ? s : undefined))
.optional(),
lifetime: number()
.positive()
.transform((n) => (isNaN(n) ? undefined : n))
.optional(),
});