Skip to content
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

Merged
merged 1 commit into from
Sep 9, 2023

Conversation

vonagam
Copy link
Contributor

@vonagam vonagam commented Sep 8, 2023

Q A
Types added? ✔/✖

Just small improvement for getError, getWarning, getErrors, getWarnings, getErrorsByGroup and getWarningsByGroup.

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 and getError("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 if variable can be undefined even though the code can handle it.

@vercel
Copy link

vercel bot commented Sep 8, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
vest ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 8, 2023 3:21am
vest-next ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 8, 2023 3:21am

@ealush
Copy link
Owner

ealush commented Sep 8, 2023

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

@vonagam
Copy link
Contributor Author

vonagam commented Sep 8, 2023

Here is a simple demonstration in typescript playground.

Copy link
Owner

@ealush ealush left a 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 👍

@ealush ealush merged commit 5aa51c6 into ealush:latest Sep 9, 2023
@vonagam vonagam deleted the types-suite-selectors branch September 9, 2023 21:26
github-actions bot pushed a commit that referenced this pull request Sep 9, 2023
…me]: (1.0.2), [vast]: (1.0.20), [n4s]: (5.0.4), [vest]: (5.0.4), [anyone]: (1.0.10)

a0bd0c4  vx: correctly track files (Evyatar)
5aa51c6  types(vest): add more method overloads to  type (#1070) (Dmitry Maganov)
ealush added a commit that referenced this pull request Sep 9, 2023
…me]: (1.0.2), [vast]: (1.0.20), [n4s]: (5.0.4), [vest]: (5.0.4), [anyone]: (1.0.10)

a0bd0c4  vx: correctly track files (Evyatar)
5aa51c6  types(vest): add more method overloads to  type (#1070) (Dmitry Maganov)
ealush added a commit that referenced this pull request Sep 9, 2023
…me]: (1.0.2), [vast]: (1.0.20), [n4s]: (5.0.4), [vest]: (5.0.4), [anyone]: (1.0.10)

a0bd0c4  vx: correctly track files (Evyatar)
5aa51c6  types(vest): add more method overloads to  type (#1070) (Dmitry Maganov)
ealush added a commit that referenced this pull request Sep 9, 2023
…me]: (1.0.2), [vast]: (1.0.20), [n4s]: (5.0.4), [vest]: (5.0.4), [anyone]: (1.0.10)

a0bd0c4  vx: correctly track files (Evyatar)
5aa51c6  types(vest): add more method overloads to  type (#1070) (Dmitry Maganov)
@ealush
Copy link
Owner

ealush commented Sep 9, 2023

Released in 5.0.4

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