fix: zod boolean强制转换
This commit is contained in:
1 parent
30a48f1693
commit
db37def059
88 files changed
+377
-331
No files matched your search
@@ -5,16 +5,16 @@ import { join as joinPath } from 'node:path';
|
||||
import { calculateFileMD5, uriToLocalFile } from '@/common/file';
|
||||
import { randomUUID } from 'crypto';
|
||||
import { z } from 'zod';
|
||||
|
||||
import { actionType } from '../type';
|
||||
interface FileResponse {
|
||||
file: string;
|
||||
}
|
||||
|
||||
const SchemaData = z.object({
|
||||
url: z.coerce.string().optional(),
|
||||
base64: z.coerce.string().optional(),
|
||||
name: z.coerce.string().optional(),
|
||||
headers: z.union([z.coerce.string(), z.array(z.coerce.string())]).optional(),
|
||||
url: actionType.string().optional(),
|
||||
base64: actionType.string().optional(),
|
||||
name: actionType.string().optional(),
|
||||
headers: z.union([actionType.string(), z.array(actionType.string())]).optional(),
|
||||
});
|
||||
|
||||
type Payload = z.infer<typeof SchemaData>;
|
||||
|
||||
Reference in new issue
Block a user