13 lines
331 B
TypeScript
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(),
|
|
});
|