Skip to content

v3.0.0

Compare
Choose a tag to compare
@cacontinuos cacontinuos released this 20 Jan 14:46
· 69 commits to master since this release

⚠ BREAKING CHANGES

  • version 3 has a bunch of changes to convert this lib into a more functional approach.

⚠️ BREAKING CHANGES

  • The way to use creditcard.js has been changed.

    See the details...

    Before:

    var CreditCard = require('creditcard.js');
    const c = new CreditCard();
    c.isValid('4916108926268679'); 
    c.isExpirationDateValid('02', '2027'); 
    c.isSecurityCodeValid('4556603578296676', '250'); 
    c.getCreditCardNameByNumber('4539578763621486');

    And now:

    import {
      isValid,
      isExpirationDateValid
      isSecurityCodeValid,
      getCreditCardNameByNumber
    } from 'creditcard.js'
    isValid('4916108926268679');
    isExpirationDateValid('02', '2027');
    isSecurityCodeValid('4916108926268679', '489');
    getCreditCardNameByNumber('4916108926268679');
  • Removed bower support

  • Removed browser use support

See more details on website: https://contaazul.github.io/creditcard.js

Added

  • Add prettier #80
  • Add rollup #64
  • New credit card types supported:
    • Banescard
    • Maxxvan
    • Cabal
    • JCB

Changed

  • Export functions instead of a constructor #78
  • Change Karma to Jest for tests #77
  • Change CI from Travis to Github Actions #105
  • New website #110

Removed

  • Remove bower support #74
  • Remove directory /dist #62
  • Removed browser use support