- Update postal code validation to:
- strip trailing and leading whitespace
- verify postal code is at least 3 characters
- confirm 1st three characters are alphanumeric
- Update
braces
to 3.0.3
- Support skipping of luhn check digit validation in card number validator.
- BREAKING CHANGES
- Update node to v18 -DevDependency Updates:
- Update prettier to v3
- Update eslint-plugin-prettier to v5
- Fix issue where a potentially valid year would evaulate as invalid (#93)
- Add
cardholderName
verification method
Breaking Changes
- Use
export =
instead ofexport default
for main export (use"esModuleInterop": true
flag in your tsconfig to maintain thedefault
module behavior)
- The cardValidator object is now available as the
default
import when using es modules (thanks @leomp12)
- Fixup export for credit-card-type for typescript projects (closes #79)
- Add typescript types
Breaking Changes
- Upgrade credit-card-type to v9.0.0
- Drop support for card numbers instantiated with
new String(number)
- Drop support for card numbers instantiated with
-
Adjust expiration date to accept dates formatted as
YYYY-MM
(the HTML autofill spec). Closes #69 (thanks @schuylr) -
Add option to set a
maxLength
for card number validation -
Update credit-card-type to v8.0.0
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 optional options object with
luhnValidateUnionPay
parameter to force luhn validity check of UnionPay cards -
Update tests to account for ELO cards
-
Update
credit-card-type
to v7.0.0
Breaking Changes
-
Mastercard enum changed from
master-card
tomastercard
-
Support custom card brands
-
Require minimum version of credit-card-type to be v6.2.0
-
Allow
maxElapsedYear
to be configurable inexpirationYear
andexpirationDate
(thanks @wozaki) -
Update
credit-card-type
to v6.0.0 -
Add options object for postal code validation to specify min length
-
Breaking change: Remove
dist
files. You must usenpm
to use this module -
Breaking change: Remove support for primitive constructors like
new String()
-
Fix postal code validation to be valid if 3 or more characters
-
correctly identify Maestro cards beginning with
6
-
Breaking change: The format of the
card
object returned has changed.pattern
has been replaced byprefixPattern
andexactPattern
. -
valid.expirationDate can take an object with month and year fields or a string value
-
Update
dist
to include version4.0.3
of credit-card-type -
Including
dist
from2.2.6
-
Fixes cases where card numbers were incorrectly reported as
isPotentiallyValid: false
when more digits could still be entered- issue #20 and PR #21
-
Fixes expiration date results when year is current year and month is invalid
-
Update files in
dist/
-
Readme clarifications
-
Fixes validation of space separated expiration dates
-
Fixes potential validity of slashless expiration dates
-
Fixes validation of expiration dates that are too long
-
Fixes CVV validation to not always validate 3-digit values as
isValid: true
-
Fixes 3-digit expiration date handling, such as 220 being Feb, 2020
-
Use one Lodash dependency
-
CVV validator can accept an array of possible length values
-
Contextually validate month based on current date.
-
Update
credit-card-type
to 4.0.0 -
The npm module now includes built files under
dist/
. -
The returned value for
card.length
is now anArray
and calledcard.lengths
to account for variable-length cards such as UnionPay. -
Initial release