Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions packages/convex-helpers/server/zod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1420,7 +1420,8 @@ export function convexToZod<V extends GenericValidator>(

let zodValidator: z.ZodTypeAny;

switch (convexValidator.kind) {
const { kind } = convexValidator;
switch (kind) {
case "id":
zodValidator = zid((convexValidator as VId<any>).tableName);
break;
Expand Down Expand Up @@ -1483,8 +1484,11 @@ export function convexToZod<V extends GenericValidator>(
);
break;
}
case "bytes":
throw new Error("v.bytes() is not supported");
default:
throw new Error(`Unknown convex validator type: ${convexValidator.kind}`);
kind satisfies never;
throw new Error(`Unknown convex validator type: ${kind}`);
}

return isOptional
Expand Down
Loading