Skip to content
New issue

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

ZodClass.nullish() is missing #20

Open
sam-goodwin opened this issue Dec 1, 2023 · 0 comments
Open

ZodClass.nullish() is missing #20

sam-goodwin opened this issue Dec 1, 2023 · 0 comments

Comments

@sam-goodwin
Copy link
Owner

Ran into sub-type errors, (ZodClass is not compatible with ZodType), when trying to add the nullish() method.

node_modules/.pnpm/file+..+.._zod@3.22.4/node_modules/zod-class/lib/cjs/index.d.ts:6:18 - error TS2430: Interface 'ZodClass<Members, Instance, Shape>' incorrectly extends interface 'ZodType<Instance, ZodTypeDef, Instance>'.
  The types of 'nullish().unwrap()._def.typeName' are incompatible between these types.
    Type 'ZodFirstPartyTypeKind.ZodOptional' is not assignable to type 'ZodFirstPartyTypeKind.ZodNullable'.

6 export interface ZodClass<Members = any, Instance = any, Shape extends ZodRawShape = ZodRawShape> extends ZodType<Instance> {

For now, have omitted it. Can always be worked around with User.schema().nullish()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant