Getting ZodIntersection left / right from instance #3980
Unanswered
CodeSmith32
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Background
Most types support mechanisms for getting the sub-types defined:
Question
If I create some
ZodIntersection
type, e.g.,how do I then extract the left / right sides from the resulting type object?
It appears I can use the
_def
property, as one could with any other type,But is this safe or recommended?
It appears to be one of only a few types that don't allow actually getting the subtypes without drilling into
_def
. Another example is gettingvalueType
out of aZodSet
.(If this is normal, that's fine. It just struck me as odd.)
Beta Was this translation helpful? Give feedback.
All reactions