zod
zod copied to clipboard
feat: added support for type negation with z.not() and .not() method …
Added support for type negation using z.not() and the .not() method in schema validation. This enhancement allows schemas to explicitly reject specific types, offering greater flexibility in data validation.
This implementation was done for ticket #2862
Changes:
Introduced the z.not() method to create schemas that reject a specified type. Enabled the .not() method to be used directly on existing schemas for easier exclusion of types. Added comprehensive test cases to validate the new z.not() functionality. Updated the documentation to include examples and usage guidelines for z.not().