We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Omit recognition failed
interface BaseElement { type: string; left: 0; top: 0; } export interface ImageElement extends Omit<BaseElement, 'type'> { type: 'image'; }
// Generated by ts-to-zod import { z } from 'zod'; const baseElementSchema = z.object({ type: z.string(), left: z.literal(0), top: z.literal(0), }); export const imageElementSchema = baseElementSchema.omit({ type: true }).extend({ type: z.literal('image'), });
// Generated by ts-to-zod import { z } from 'zod'; const baseElementSchema = z.object({ type: z.string(), left: z.literal(0), top: z.literal(0), });
Versions
v5.2.22
v3.8.3
The text was updated successfully, but these errors were encountered:
Hello,
As a potential workaround, this does work with a type:
type BaseElement = { type: string; left: 0; top: 0; }; export type ImageElement = Omit<BaseElement, "type"> & { type: "image"; };
Sorry, something went wrong.
No branches or pull requests
Bug description
Omit recognition failed
Input
Expected output
Actual output
Versions
v5.2.22
v3.8.3
The text was updated successfully, but these errors were encountered: