braintree / credit-card-type

A library for determining credit card type
MIT License
985 stars 154 forks source link

Correcting the issue 107 ELO/Maestro incorrect type #113

Closed gabrielozaki closed 4 years ago

gabrielozaki commented 4 years ago

Hi!

I opened the issue #107

After the typerscript migration I'm opening a pull request to correct the problem using the @crookedneighbor proposal.

How to test:

const eloCard = creditCardType('504175');
console.log(eloCard);

Expected result:

[ { niceType: 'Elo',
    type: 'elo',
    patterns:
     [ 401178,
(...)
    gaps: [ 4, 8, 12 ],
    lengths: [ 16 ],
    code: { name: 'CVE', size: 3 },
    matchStrength: 6 } ]

NOTE: I delete the original fork on my repositories, so I had to re-fork and create a new Pull Request, sorry by that

gabrielozaki commented 4 years ago

@crookedneighbor recommended the test added to the src/tests/index.ts, this is the new modification of this PR

crookedneighbor commented 4 years ago

This is out in v9.0.1