-
-
Notifications
You must be signed in to change notification settings - Fork 85
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
types(vest): add more method overloads to SuiteSelectors
type
#1070
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Hm. let me go over it. I did not experience it, and I am worried this will change the behavior of the overloads. I'll run a few tests |
Here is a simple demonstration in typescript playground. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @vonagam! Ran a couple of tests and this looks good 👍
Released in 5.0.4 |
Just small improvement for
getError
,getWarning
,getErrors
,getWarnings
,getErrorsByGroup
andgetWarningsByGroup
.All three variants - without argument / with required argument / with optional optional - need to be provided to cover all possible cases.
If only one provided - an optional argument (like in
getError
/getWarning
) - then a result is not as specific as it could be:getError()
without an argument should not say that the result can be a string andgetError("field")
cannot include an object in its result.If only two provided - without and with required (like in rest of listed funcs) - then typescript forbids to call a function with an undefined, so
getWarnings(variable)
is treated as wrong ifvariable
can be undefined even though the code can handle it.