Skip to content

Add credit card testing for strings. Closes #42#444

Closed
notjrbauer wants to merge 5 commits intohapijs:masterfrom
notjrbauer:cc
Closed

Add credit card testing for strings. Closes #42#444
notjrbauer wants to merge 5 commits intohapijs:masterfrom
notjrbauer:cc

Conversation

@notjrbauer
Copy link

Tests taken from @Christopher-Bui's initial PR.

lib/string.js Outdated
Copy link
Contributor

Choose a reason for hiding this comment

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

for loop is more readable

@hueniverse hueniverse added the feature New functionality or improvement label Oct 10, 2014
@hueniverse hueniverse self-assigned this Oct 10, 2014
@hueniverse
Copy link
Contributor

Nice. Just need to close the comments above.

@danielb2
Copy link
Contributor

Is there a reason to use string() and not number() for this?

@danielb2
Copy link
Contributor

Further, I think the implementation referenced in the original request #422 is nicer.

@danielb2
Copy link
Contributor

btw, I don't mean to step on anyone's toes, so do accept the other implementation. I'm just adding mine because it's how I would have done it.

@cjihrig
Copy link
Contributor

cjihrig commented Oct 31, 2014

I'm a little confused why #465 trumped this PR? A credit card number should be treated as a string, not a number for several reasons. You will never do math on a credit card number (JavaScript floating point math at that), and the implementation in #465 converts the number to a string internally. Additionally, this PR appears to have been approved, pending a few small tweaks.

@Marsup
Copy link
Collaborator

Marsup commented Nov 3, 2014

I think we can all agree it's fixed by #469. Reply if not.

@Marsup Marsup closed this Nov 3, 2014
@hueniverse hueniverse assigned Marsup and unassigned hueniverse Nov 3, 2014
@lock
Copy link

lock bot commented Jan 9, 2020

This thread has been automatically locked due to inactivity. Please open a new issue for related bugs or questions following the new issue template instructions.

@lock lock bot locked as resolved and limited conversation to collaborators Jan 9, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

feature New functionality or improvement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants