- Update (sub-)dependencies
cross-spawn
to 7.0.6micromatch
to 4.0.8semver
to 6.3.1
- Update
braces
to 3.0.3
- BREAKING CHANGES
- Update Node to v18 -DevDependencies
- Update prettier to v3
- Update eslint-plugin-prettier to v5
- Typescript to v5
- Add additional Hiper bins (#115 thanks @upigilam)
- Correct issue where ELO cards were misidentified as Maestro cards (thanks @gabrielozaki)
- Add typescript types
Breaking Changes
- Drop Bower Support
- Drop support for card numbers instantiated with
new String(number)
- Add support for series 8 UnionPay cards (fixes #95 thanks @leebradley)
- Add 14 and 15 length configuration to UnionPay cards
- Add support for Hiper cards
- Add support for Hipercard cards
- Improve pattern recognition for card types
Breaking Changes
- When adding or updating cards, this module no longer uses an
exactPattern
andprefixPattern
model. Instead, it takes an array of patterns. See https://github.com/braintree/credit-card-type#pattern-detection for details.
- Add support for
Elo
card type - Adds
updateCard
method (#77)
- Updates "master-card" enum to "mastercard"
- Add support for
MIR
card type (thanks @antongolub)
- Allow custom card brands to be added
- Correct Mastercard bin range for series 2 bins
- Add support for JCB cards of length 17, 18, and 19 (#54, thanks @zeh)
- Update mastercard niceType property to
Mastercard
to match new brand guidelines
Breaking Changes
- Remove internal properties
prefixPattern
andexactPattern
from returned object
- Correct Discover to respect lengths for international cards
- Make Maestro pattern more exact
- Fix prefix pattern for MasterCard numbers starting with
27
- Fix checking for UnionPay ranges
- Visa cards can now be 16, 18, or 19 digits.
-
Card matching has been replaced with a two-tier process. This simplifies the matching process for ambiguous numbers.
-
Partial BIN matches (
prefixPattern
) are accumulated separately from exact BIN matches (exactPattern
). -
If there were any exact BIN matches, those matches are returned.
-
If there are no exact BIN matches, all partial matches are returned.
- Add
getTypeInfo
andtypes
exports for getting type information such as number spacing given a type string such asvisa
.
- Remove behavior where some UnionPay cards displayed Discover and UnionPay as possible card types
- Add support for series 2 MasterCard bins (ranging from 222100 to 272099)
- Removes dependency on Lodash
- Switch to one version of Lodash
- Further resolve ambiguity issues with various cards; return an array of potential card types instead of a single type
- Resolve ambiguity issues with Maestro and Discover cards
- Add support for Maestro and UnionPay
- Change return type of
length
as aString
tolengths
as anArray
- Initial Release