Skip to content

Typing is incorrect for partialSafeParse #17

@apatrida

Description

@apatrida

The parameter type Schema extends z.AnyZodObject shoudl be SchemaType extends z.ZodTypeAny to support all root level types including discriminative types, arrays, etc.

Also the typing of the response should be:

validData: Partial<z.output<Schema>>; // type after transforms, pipes
invalidData: Partial<z.input<Schema>>; // type before any zod transformation

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions