zod icon indicating copy to clipboard operation
zod copied to clipboard

feat: added support for type negation with z.not() and .not() method …

Open Kumar06Lav opened this issue 6 months ago • 2 comments

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().

Kumar06Lav avatar Aug 14 '24 07:08 Kumar06Lav