Skip to content

Commit

Permalink
Merge pull request #31 from wejrox/Switch-to-ES6-object-method-shorth…
Browse files Browse the repository at this point in the history
…and-in-clabe.js

Switch to ES6 object method shorthand in clabe.js
  • Loading branch information
dpilafian authored Oct 7, 2020
2 parents 7d6c8cc + b09d761 commit f605e74
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions clabe.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const clabe = {

version: '[VERSION]',

computeChecksum: (clabeNum17) => {
computeChecksum(clabeNum17) {
// Returns the checksum calculated from the first 17 characters of CLABE number.
// Example:
// const checksum = clabe.computeChecksum('00201007777777777'); //value: 1
Expand All @@ -13,7 +13,7 @@ const clabe = {
return /^[0-9]{17,18}$/.test(clabeNum17) ? compute() : null;
},

validate: (clabeNum) => {
validate(clabeNum) {
// Returns information in a map (object literal) about the CLABE number.
// Example:
// const city = clabe.validate('002010077777777771').city; //value: "Banco Nacional de México"
Expand Down Expand Up @@ -67,7 +67,7 @@ const clabe = {
};
},

calculate: (bankCode, cityCode, accountNumber) => {
calculate(bankCode, cityCode, accountNumber) {
// Returns an 18-character CLABE number.
// Example:
// const clabeNum = clabe.calculate(2, 10, 7777777777); //value: "002010077777777771"
Expand Down

0 comments on commit f605e74

Please sign in to comment.