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

feat(isBase32): Add option for Crockford's base 32 alternative #1888

Merged
merged 3 commits into from
Apr 22, 2022

Conversation

BigOsvaap
Copy link
Contributor

@BigOsvaap BigOsvaap commented Dec 22, 2021

This PR adds feature requested on issue #1857

Checklist

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

@codecov
Copy link

codecov bot commented Dec 22, 2021

Codecov Report

Merging #1888 (177be3d) into master (f055c11) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##            master     #1888   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          102       102           
  Lines         2072      2078    +6     
  Branches       472       473    +1     
=========================================
+ Hits          2072      2078    +6     
Impacted Files Coverage Δ
src/lib/isBase32.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 f055c11...177be3d. Read the comment docs.

Comment on lines 5754 to 5770

test({
validator: 'isBase32',
args: [{ crockford: true }],
valid: [
'91JPRV3F41BPYWKCCGGG',
'60',
'64',
'B5QQA833C5Q20S3F41MQ8',
],
invalid: [
'91JPRV3F41BUPYWKCCGGG',
'B5QQA833C5Q20S3F41MQ8L',
'60I',
'B5QQA833OULIC5Q20S3F41MQ8',
],
});
Copy link
Contributor

Choose a reason for hiding this comment

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

I would suggest you move this test out to its own it() statement so it is more clear precisely what is being tested. At least many other tests are split up like this. See 'should validate JSON' and 'should validate JSON with primitives'.

Examples to the contrary are found as well ('should validate ISSNs' has everything in one it() statement), so I suppose a clarification of the convention here would be nice, but that's a bigger topic.

@BigOsvaap
Copy link
Contributor Author

I move the test out. 🙂

README.md Outdated Show resolved Hide resolved
Co-authored-by: Brage <[email protected]>
@braaar
Copy link
Contributor

braaar commented Jan 13, 2022

I think the title should be feat(isBase32): Add option for Crockford's base 32 alternative

@BigOsvaap BigOsvaap changed the title feat(crockforbase32): Add option for Crockford's base 32 alternative feat(isBase32): Add option for Crockford's base 32 alternative Jan 13, 2022
@BigOsvaap
Copy link
Contributor Author

I updated the name of the PR :)

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.

// Sorry for the delay in reviewing this.

@profnandaa profnandaa merged commit cf8dcea into validatorjs:master Apr 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants