Skip to content

feat(isCPF): adding validator for CPF (brazilian SSN) #1589

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

Closed
wants to merge 1 commit into from

Conversation

renanmontebelo
Copy link
Contributor

Adding validator isCPF(str, options). CPF in Brazil is analogous to Social Security Number in the US.

The validator has options to require, disallow or don't care (default) about separator characters.

Checklist

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

@codecov
Copy link

codecov bot commented Jan 31, 2021

Codecov Report

Merging #1589 (be193cb) into master (1b85829) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##            master     #1589   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          100       101    +1     
  Lines         1796      1820   +24     
=========================================
+ Hits          1796      1820   +24     
Impacted Files Coverage Δ
src/lib/isPassportNumber.js 100.00% <ø> (ø)
src/index.js 100.00% <100.00%> (ø)
src/lib/isCPF.js 100.00% <100.00%> (ø)
src/lib/isDataURI.js 100.00% <100.00%> (ø)
src/lib/isIdentityCard.js 100.00% <100.00%> (ø)
src/lib/isMACAddress.js 100.00% <100.00%> (ø)
src/lib/isStrongPassword.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 1b85829...7bff9a9. Read the comment docs.

@tux-tn
Copy link
Member

tux-tn commented Mar 1, 2021

I closed the PR to rerun the tests. Thank you for your contrib @renanmontebelo , can you please explain the difference between isCPF and the existing isTaxID ?

@renanmontebelo
Copy link
Contributor Author

Closing in favor of #1613

@renanmontebelo
Copy link
Contributor Author

renanmontebelo commented Mar 6, 2021

@tux-tn now that I know better, isCPF should indeed be part of isTaxID. #1613 uses this approach so I'm closing this PR in favor of that one. Thank you!

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.

2 participants