kopia lustrzana https://gitlab.com/soapbox-pub/soapbox
14 wiersze
300 B
TypeScript
14 wiersze
300 B
TypeScript
import z from 'zod';
|
|
|
|
const relaySchema = z.preprocess((data: any) => {
|
|
return { id: data.actor, ...data };
|
|
}, z.object({
|
|
actor: z.string().catch(''),
|
|
id: z.string(),
|
|
followed_back: z.boolean().catch(false),
|
|
}));
|
|
|
|
type Relay = z.infer<typeof relaySchema>
|
|
|
|
export { relaySchema, type Relay };
|