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

fix(isUUID): handle of null version value #1777

Merged
merged 1 commit into from
Oct 30, 2021

Conversation

theteladras
Copy link
Contributor

The issue here lies in that, where the defaulting of argument is only managed for when the value of the version is 'undefined', and for other falsy values (in my case 'null') it accepts them. There are cases where functions do trigger callbacks with null values instead of undefined, and it usually leads to unexpected outcomes. I do believe that this is the general understanding of how the function should be used, when the version argument is falsy, it should check for 'all' pattern.

The particular issue is here:

Screenshot 2021-10-12 at 13 48 29

Checklist

  • PR contains only changes related; no stray files, etc.
  • README updated (where applicable)
  • Tests written (where applicable)

@codecov
Copy link

codecov bot commented Oct 12, 2021

Codecov Report

Merging #1777 (ee191f7) into master (13651ea) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##            master     #1777   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          102       102           
  Lines         2029      2029           
  Branches       457       457           
=========================================
  Hits          2029      2029           
Impacted Files Coverage Δ
src/lib/isUUID.js 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 13651ea...ee191f7. Read the comment docs.

src/lib/isUUID.js Outdated Show resolved Hide resolved
Copy link
Member

@tux-tn tux-tn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @theteladras for your efforts ! LGTM 🎉
We should replace this with the nullish coalescing operator when the CI/Testing problems will be fixed!

@tux-tn tux-tn added ready-to-land For PRs that are reviewed and ready to be landed 🎉 first-pr labels Oct 15, 2021
Copy link
Member

@profnandaa profnandaa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks for your contrib! 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🎉 first-pr ready-to-land For PRs that are reviewed and ready to be landed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants