mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2026-03-02 00:30:25 +00:00
fix:coerce
This commit is contained in:
@@ -3,7 +3,7 @@ import { GetPacketStatusDepends } from '@/onebot/action/packet/GetPacketStatus';
|
||||
import { z } from 'zod';
|
||||
|
||||
const SchemaData = z.object({
|
||||
user_id: z.union([z.number(), z.string()])
|
||||
user_id: z.union([z.coerce.number(), z.coerce.string()])
|
||||
});
|
||||
|
||||
type Payload = z.infer<typeof SchemaData>;
|
||||
|
||||
@@ -7,7 +7,7 @@ interface Response {
|
||||
}
|
||||
|
||||
const SchemaData = z.object({
|
||||
domain: z.string()
|
||||
domain: z.coerce.string()
|
||||
});
|
||||
|
||||
type Payload = z.infer<typeof SchemaData>;
|
||||
|
||||
@@ -5,7 +5,7 @@ import { ActionName } from '@/onebot/action/router';
|
||||
import { z } from 'zod';
|
||||
|
||||
const SchemaData = z.object({
|
||||
no_cache: z.boolean().optional(),
|
||||
no_cache: z.coerce.boolean().optional(),
|
||||
});
|
||||
|
||||
type Payload = z.infer<typeof SchemaData>;
|
||||
|
||||
@@ -5,7 +5,7 @@ import { NetworkAdapterConfig } from '@/onebot/config/config';
|
||||
import { z } from 'zod';
|
||||
|
||||
const SchemaData = z.object({
|
||||
count: z.number().default(10),
|
||||
count: z.coerce.number().default(10),
|
||||
});
|
||||
|
||||
type Payload = z.infer<typeof SchemaData>;
|
||||
|
||||
@@ -3,8 +3,8 @@ import { ActionName } from '@/onebot/action/router';
|
||||
import { z } from 'zod';
|
||||
|
||||
const SchemaData = z.object({
|
||||
times: z.union([z.number(), z.string()]).default(1),
|
||||
user_id: z.union([z.number(), z.string()])
|
||||
times: z.union([z.coerce.number(), z.coerce.string()]).default(1),
|
||||
user_id: z.union([z.coerce.number(), z.coerce.string()])
|
||||
});
|
||||
|
||||
type Payload = z.infer<typeof SchemaData>;
|
||||
|
||||
@@ -3,9 +3,9 @@ import { ActionName } from '@/onebot/action/router';
|
||||
import { z } from 'zod';
|
||||
|
||||
const SchemaData = z.object({
|
||||
flag: z.union([z.string(), z.number()]),
|
||||
approve: z.union([z.string(), z.boolean()]).default(true),
|
||||
remark: z.union([z.string(), z.null()]).nullable().optional()
|
||||
flag: z.union([z.coerce.string(), z.coerce.number()]),
|
||||
approve: z.union([z.coerce.string(), z.coerce.boolean()]).default(true),
|
||||
remark: z.union([z.coerce.string(), z.null()]).nullable().optional()
|
||||
});
|
||||
|
||||
type Payload = z.infer<typeof SchemaData>;
|
||||
|
||||
Reference in New Issue
Block a user