Commit 4c25f26
authored
refactor(isCreditCard): create allCards dynamically (#2117)
* refactor(isCreditCard): create allCards dynamically
get rid of the hardcoded allCards variable, which was a manual copy of the existing regExp for card provider.
Replace it with a dynamically created array instead, which will make it easier to maintain, when new providers are added.
* chore: code coverage improvement
add "istanbull ignore else", similarly to how it is was done in:
9ee09a71 parent 3507d27 commit 4c25f26
1 file changed
+12
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
14 | | - | |
15 | | - | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
16 | 24 | | |
17 | 25 | | |
18 | 26 | | |
| |||
26 | 34 | | |
27 | 35 | | |
28 | 36 | | |
29 | | - | |
| 37 | + | |
30 | 38 | | |
31 | 39 | | |
32 | 40 | | |
| |||
0 commit comments