mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-06-06 05:04:22 +00:00
11 lines
271 B
TypeScript
11 lines
271 B
TypeScript
import { z } from 'zod';
|
|||
|
|||
export const msgSchema = <T extends z.ZodType>(obj: T) =>
|
|||
z.object({
|
|||
success: z.boolean(),
|
|||
msg: z.string().default(''),
|
|||
obj: obj.nullable(),
|
|||
});
|
|||
|
|||
export type MsgOf<S extends z.ZodType> = z.infer<ReturnType<typeof msgSchema<S>>>;
|