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(Byte): hexValidator should remove leading 0 #717

Merged
merged 1 commit into from
Feb 17, 2021
Merged

Conversation

rufman
Copy link
Contributor

@rufman rufman commented Feb 17, 2021

Description

A leading 0 in the hex string can throw off the hex validator, since
this information is lost in the parseInt action. This results in the
string check to return false instead of true, because the parsed
hex string does not contain the leading 0.

Related #716

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

Added a test for a hex string containing a leading 0 ('04080f10172a')

Test Environment:

  • OS: Mac OS
  • GraphQL Scalars Version: 1.7.0
  • NodeJS: 14.15

Checklist:

  • I have followed the CONTRIBUTING doc and the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests and linter rules pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

A leading 0 in the hex string can throw off the hex validator, since
this information is lost in the parseInt action. This results in the
string check to return `false` instead of `true`, because the parsed
hex string does not contain the leading 0.
@ardatan
Copy link
Collaborator

ardatan commented Feb 17, 2021

Thanks @rufman !

@ardatan ardatan merged commit a2273e6 into Urigo:master Feb 17, 2021
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