Skip to content

fix: use merge instead of intersection#28

Merged
mnahkies merged 1 commit intomasterfrom
mn/fix/use-merge
Apr 2, 2023
Merged

fix: use merge instead of intersection#28
mnahkies merged 1 commit intomasterfrom
mn/fix/use-merge

Conversation

@mnahkies
Copy link
Owner

@mnahkies mnahkies commented Apr 2, 2023

intersection actually takes a left and right parameter, rather than an array.

additionally from the docs:

Though in many cases, it is recommended to use A.merge(B) to merge two objects. The .merge method returns a new ZodObject instance, whereas A.and(B) returns a less useful ZodIntersection instance that lacks common object methods like pick and omit.

@mnahkies mnahkies enabled auto-merge (squash) April 2, 2023 12:43
@mnahkies mnahkies merged commit 062455a into master Apr 2, 2023
@mnahkies mnahkies deleted the mn/fix/use-merge branch April 2, 2023 12:46
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.

1 participant