fix: zod boolean强制转换
This commit is contained in:
1 parent
cc30b51d58
commit
17ef3231df
88 files changed
+377
-331
No files matched your search
@@ -1,12 +1,13 @@
|
||||
import { OneBotAction } from '@/onebot/action/OneBotAction';
|
||||
import { ActionName } from '@/onebot/action/router';
|
||||
import { z } from 'zod';
|
||||
import { actionType } from '../type';
|
||||
|
||||
const SchemaData = z.object({
|
||||
friend_id: z.coerce.string().optional(),
|
||||
user_id: z.coerce.string().optional(),
|
||||
temp_block: z.coerce.boolean().optional(),
|
||||
temp_both_del: z.coerce.boolean().optional(),
|
||||
friend_id: actionType.string().optional(),
|
||||
user_id: actionType.string().optional(),
|
||||
temp_block: actionType.boolean().optional(),
|
||||
temp_both_del: actionType.boolean().optional(),
|
||||
});
|
||||
|
||||
type Payload = z.infer<typeof SchemaData>;
|
||||
|
||||
Reference in new issue
Block a user