Skip to content

Commit

Permalink
Release v3.0.2
Browse files Browse the repository at this point in the history
  • Loading branch information
dpilafian committed Aug 14, 2024
1 parent cbc5600 commit 9d8e6b3
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ interesting approach to organizing build tasks.
- 🪺 [recursive-exec](https://github.com/center-key/recursive-exec):  _Run a command on each file in a folder and its subfolders_
- 🔍 [replacer-util](https://github.com/center-key/replacer-util):  _Find and replace strings or template outputs in text files_
- 🔢 [rev-web-assets](https://github.com/center-key/rev-web-assets):  _Revision web asset filenames with cache busting content hash fingerprints_
- 🚆 [run-scripts-util](https://github.com/center-key/run-scripts-util):  _Organize npm package.json scripts into named groups of easy to manage commands_
- 🚆 [run-scripts-util](https://github.com/center-key/run-scripts-util):  _Organize npm package.json scripts into groups of easy to manage commands_
- 🚦 [w3c-html-validator](https://github.com/center-key/w3c-html-validator):  _Check the markup validity of HTML files using the W3C validator_

<br>
Expand Down
2 changes: 1 addition & 1 deletion dist/clabe.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//! clabe-validator v3.0.1 ~~ https://github.com/center-key/clabe-validator ~~ MIT License
//! clabe-validator v3.0.2 ~~ https://github.com/center-key/clabe-validator ~~ MIT License

export type ClabeBank = {
tag?: string;
Expand Down
10 changes: 5 additions & 5 deletions dist/clabe.dev.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//! clabe-validator v3.0.1 ~~ https://github.com/center-key/clabe-validator ~~ MIT License
//! clabe-validator v3.0.2 ~~ https://github.com/center-key/clabe-validator ~~ MIT License

const clabe = {
version: '3.0.1',
version: '3.0.2',
computeChecksum(clabeNum17) {
const x = (i) => [3, 7, 1][i % 3];
const add = (sum, digit, i) => sum + (Number(digit) * x(i)) % 10;
Expand All @@ -17,7 +17,7 @@ const clabe = {
city: 'Invalid city code: ',
};
if (typeof clabeNum !== 'string')
throw 'clabe.validator.check(clabeNum) -- Expected string, got: ' + typeof clabeNum;
throw new Error('clabe.validator.check(clabeNum) -- Expected string, got: ' + typeof clabeNum);
const bankCode = clabeNum.substring(0, 3);
const cityCode = clabeNum.substring(3, 6);
const account = clabeNum.substring(6, 17);
Expand All @@ -41,7 +41,7 @@ const clabe = {
ok: !validation,
formatOk: !validation || ['bank', 'city'].includes(validation.invalid),
error: validation ? 'invalid-' + validation.invalid : null,
message: validation ? errorMap[validation.invalid] + validation.data : 'Valid',
message: validation ? errorMap[validation.invalid] + String(validation.data) : 'Valid',
clabe: validation ? null : clabeNum,
tag: bank.tag || null,
bank: bank.name || null,
Expand All @@ -57,7 +57,7 @@ const clabe = {
const pad = (text, len) => text.length < len ? pad('0' + text, len) : text;
const fit = (num, len) => pad(num.toString(), len).slice(-len);
const clabeNum = fit(bankCode, 3) + fit(cityCode, 3) + fit(accountNumber, 11);
return clabeNum + clabe.computeChecksum(clabeNum);
return clabeNum + String(clabe.computeChecksum(clabeNum));
},
banksMap: {
1: { tag: 'BANXICO', name: 'Banco de México' },
Expand Down
10 changes: 5 additions & 5 deletions dist/clabe.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//! clabe-validator v3.0.1 ~~ https://github.com/center-key/clabe-validator ~~ MIT License
//! clabe-validator v3.0.2 ~~ https://github.com/center-key/clabe-validator ~~ MIT License

const clabe = {
version: '3.0.1',
version: '3.0.2',
computeChecksum(clabeNum17) {
const x = (i) => [3, 7, 1][i % 3];
const add = (sum, digit, i) => sum + (Number(digit) * x(i)) % 10;
Expand All @@ -17,7 +17,7 @@ const clabe = {
city: 'Invalid city code: ',
};
if (typeof clabeNum !== 'string')
throw 'clabe.validator.check(clabeNum) -- Expected string, got: ' + typeof clabeNum;
throw new Error('clabe.validator.check(clabeNum) -- Expected string, got: ' + typeof clabeNum);
const bankCode = clabeNum.substring(0, 3);
const cityCode = clabeNum.substring(3, 6);
const account = clabeNum.substring(6, 17);
Expand All @@ -41,7 +41,7 @@ const clabe = {
ok: !validation,
formatOk: !validation || ['bank', 'city'].includes(validation.invalid),
error: validation ? 'invalid-' + validation.invalid : null,
message: validation ? errorMap[validation.invalid] + validation.data : 'Valid',
message: validation ? errorMap[validation.invalid] + String(validation.data) : 'Valid',
clabe: validation ? null : clabeNum,
tag: bank.tag || null,
bank: bank.name || null,
Expand All @@ -57,7 +57,7 @@ const clabe = {
const pad = (text, len) => text.length < len ? pad('0' + text, len) : text;
const fit = (num, len) => pad(num.toString(), len).slice(-len);
const clabeNum = fit(bankCode, 3) + fit(cityCode, 3) + fit(accountNumber, 11);
return clabeNum + clabe.computeChecksum(clabeNum);
return clabeNum + String(clabe.computeChecksum(clabeNum));
},
banksMap: {
1: { tag: 'BANXICO', name: 'Banco de México' },
Expand Down
4 changes: 2 additions & 2 deletions dist/clabe.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<link rel=apple-touch-icon href=https://centerkey.com/graphics/mobile-home-screen.png>
<link rel=preconnect href=https://fonts.googleapis.com>
<link rel=preconnect href=https://fonts.gstatic.com crossorigin>
<link rel=stylesheet href=https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6.5/css/all.min.css>
<link rel=stylesheet href=https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6.6/css/all.min.css>
<link rel=stylesheet href=https://cdn.jsdelivr.net/npm/dna-engine@3.2/dist/dna-engine.css>
<link rel=stylesheet href=https://cdn.jsdelivr.net/npm/web-ignition@2.2/dist/reset.min.css>
<link rel=stylesheet href=https://cdn.jsdelivr.net/npm/web-ignition@2.2/dist/layouts/letterbox.css>
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "clabe-validator",
"version": "3.0.1",
"version": "3.0.2",
"description": "Analyze or create a CLABE number for a Mexican bank account (written in functional TypeScript)",
"license": "MIT",
"type": "module",
Expand Down Expand Up @@ -67,7 +67,7 @@
"devDependencies": {
"@eslint/js": "~9.9",
"@fortawesome/fontawesome-free": "~6.6",
"@types/node": "~22.2",
"@types/node": "~22.3",
"add-dist-header": "~1.4",
"assert-deep-strict-equal": "~1.2",
"copy-file-util": "~1.2",
Expand Down

0 comments on commit 9d8e6b3

Please sign in to comment.