-
Notifications
You must be signed in to change notification settings - Fork 90
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Exact record support #162
base: master
Are you sure you want to change the base?
Exact record support #162
Conversation
Nop :/ I made my own build so I could use this change + Omit
If you are interested |
@reinismu You closed this issue but does it work for an object with both required and optional keys, to make sure there are either no required keys missing, or no additional keys, beyond the optional ones, specified? I don't see that case in your tests.
This will check that:
Basically I don't think an exact spec on any intersection type works, since it's not the same as the intersection of the exact types... |
@jraoult Thanks! It seems promising @bayareacoder From use of it I have noticed few edge cases where it doesn't work. One of them is when trying to use |
This would come in handy once #113 get merged, as there will be no need to use a tricky syntax like |
Added
.exact()
forRecord
. It allows to check that incoming object doesn't have additional fields.Close #41
First I tried to create
{ strict: true }
, butvalidate
,check
etc. are shared between multiple Runtypes and they don't really need that setting.