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

Vue: Fix enum check in extractArgTypes #18959

Merged
merged 1 commit into from
Aug 22, 2022

Conversation

ProjektGopher
Copy link
Contributor

This is a followup to PR#18710 as there was a second bug on the same line that wasn't apparent until my extra type check was implemented using nullish coallescing.

If this can be included in v6.5.11 you have no idea how much of a help that would be for me personally on this particular client's work

Issue:
The string check at the end of this line is wrong, allowing null or undefined to pass through to the rest of the method instead of returning false.

What I did

// code/renderers/vue/src/docs/extractArgTypes.ts
- const matched = Array.isArray(values) && values.length && type?.name !== 'enum';
+ const matched = Array.isArray(values) && values.length && type?.name === 'enum';

@shilman shilman added bug vue patch:yes Bugfix & documentation PR that need to be picked to main branch argtypes labels Aug 22, 2022
@shilman shilman changed the title Fix string check in extractArgTypes Vue: Fix string check in extractArgTypes Aug 22, 2022
@shilman shilman changed the title Vue: Fix string check in extractArgTypes Vue: Fix enum check in extractArgTypes Aug 22, 2022
@shilman shilman merged commit 3a8b9fc into storybookjs:next Aug 22, 2022
@ProjektGopher ProjektGopher deleted the fix/extractArgTypes branch August 22, 2022 16:54
@shilman shilman added the patch:done Patch/release PRs already cherry-picked to main/release branch label Aug 22, 2022
shilman added a commit that referenced this pull request Aug 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
argtypes bug patch:done Patch/release PRs already cherry-picked to main/release branch patch:yes Bugfix & documentation PR that need to be picked to main branch vue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants