-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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(isLuhnValid): Expose isLuhnValid independently from isCreditCard #1974
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1974 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 103 104 +1
Lines 2097 2104 +7
Branches 473 473
=========================================
+ Hits 2097 2104 +7
Continue to review full report at Codecov.
|
isCreditCard is testing different aspects as well. Can you add special tests for isLuhnValid? |
Done |
Suggesting a rename to |
Currently the luhn checking algorithm is only used inside isCreditCard, but the luhn algorithm is also used in/for other "numbers", so it would be nice if the
isLuhnValid
could be exposed independently.Source: https://en.wikipedia.org/wiki/Luhn_algorithm
The code is copied from the existing
isCreditCard
check.Checklist
Tests fromisCreditCard
apply, if any exist.