Skip to content

Conversation

@itaysabato
Copy link

No description provided.

- Add uniqueItems validation using fast-deep-equal for deep comparison
- Fix array validation by adding array-level getZodChain that preserves isRequired
- Prevent object property processing from double-chaining arrays
- Add comprehensive tests for uniqueItems validation scenarios
- Add fast-deep-equal dependency for reliable deep equality checks

The uniqueItems validation is applied last in the validation chain since .refine()
returns ZodEffects which doesn't support further method chaining.

Arrays now properly handle both required and optional status while supporting
uniqueItems validation without duplication.
@itaysabato itaysabato marked this pull request as draft July 24, 2025 09:03
itaysabato and others added 4 commits July 24, 2025 12:38
- Return false immediately when duplicate found instead of processing entire array
- Functionally equivalent but more efficient for arrays with duplicates
- Updated test snapshots to reflect optimized logic
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

Successfully merging this pull request may close these issues.

2 participants