@yimingliao/cms 0.0.31 → 0.0.33
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/server/index.d.ts +2 -2
- package/dist/server/index.js +2 -2
- package/package.json +1 -1
package/dist/server/index.d.ts
CHANGED
|
@@ -170,7 +170,7 @@ declare function createSchemas({ z, localeArray, exist, }: {
|
|
|
170
170
|
declare function createFileSchema({ z, maxSizeInMb, }: {
|
|
171
171
|
z: ReturnType<typeof createZod>;
|
|
172
172
|
maxSizeInMb: number;
|
|
173
|
-
}): ({ size, extensions, }
|
|
173
|
+
}): ({ size, extensions, }?: {
|
|
174
174
|
size?: number;
|
|
175
175
|
extensions?: string[];
|
|
176
176
|
}) => zod.ZodPipe<zod.ZodCustom<File, File>, zod.ZodTransform<BlobFile, File>>;
|
|
@@ -181,7 +181,7 @@ declare function createMultiFileSchema({ z, fileSchema, maxSizeInMb, }: {
|
|
|
181
181
|
}): ({ size, extensions, }?: {
|
|
182
182
|
size?: number;
|
|
183
183
|
extensions?: string[];
|
|
184
|
-
}) =>
|
|
184
|
+
}) => zod.ZodArray<zod.ZodPipe<zod.ZodCustom<File, File>, zod.ZodTransform<BlobFile, File>>>;
|
|
185
185
|
|
|
186
186
|
declare function createTocItemSchema({ z, schemas, }: {
|
|
187
187
|
z: ReturnType<typeof createZod>;
|
package/dist/server/index.js
CHANGED
|
@@ -555,7 +555,7 @@ function createFileSchema({
|
|
|
555
555
|
return function fileSchema({
|
|
556
556
|
size = maxSizeInMb * SIZE.MB,
|
|
557
557
|
extensions = []
|
|
558
|
-
}) {
|
|
558
|
+
} = {}) {
|
|
559
559
|
return z2.instanceof(File, { error: "Invalid file" }).refine((file) => file.size <= size, {
|
|
560
560
|
error: `File is too large, max ${size / SIZE.MB}MB`
|
|
561
561
|
}).refine(
|
|
@@ -578,7 +578,7 @@ function createMultiFileSchema({
|
|
|
578
578
|
size = maxSizeInMb * SIZE.MB,
|
|
579
579
|
extensions = []
|
|
580
580
|
} = {}) {
|
|
581
|
-
z2.array(fileSchema({ size, extensions }));
|
|
581
|
+
return z2.array(fileSchema({ size, extensions }));
|
|
582
582
|
};
|
|
583
583
|
}
|
|
584
584
|
|