Skip to content

Support exactOptionalPropertyTypes for partial and optional helpers #1510

@vlinder

Description

@vlinder

Hi!

Zod is adding the undefined type to all keys that are optional when using the different .partial() modifiers.

How about differentiating them by being present and undefined or just not present at all like typescript does with exactOptionalPropertyTypes: true.

Would it be possible to implement in zod? I guess it could be the default since if you don't care you don't care. Also just using the typescript Partial type will actually honor exactOptionalPropertyTypes by default (on the type level that is).

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions