Skip to content

Commit a9dbd68

Browse files
committed
Fix bug in validators.
1 parent 19f69a1 commit a9dbd68

File tree

6 files changed

+6
-6
lines changed

6 files changed

+6
-6
lines changed

example/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "nip24example",
3-
"version": "1.2.3",
3+
"version": "1.2.4",
44
"description": "NIP24 Client for Javascript - Example",
55
"author": "",
66
"license": "Apache-2.0",

lib/euvat.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ function normalize(nip)
3434
return undefined;
3535
}
3636

37-
nip = nip.replace('-', '').replace(' ', '').trim().toUpperCase();
37+
nip = nip.replace(/[ -]/g, '').trim().toUpperCase();
3838

3939
if (!nip.match(/^[A-Z]{2}[A-Z0-9]{2,12}$/)) {
4040
return undefined;

lib/iban.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ function normalize(iban)
3232
return undefined;
3333
}
3434

35-
iban = iban.replace('-', '').replace(' ', '').trim().toUpperCase();
35+
iban = iban.replace(/[ -]/g, '').trim().toUpperCase();
3636

3737
if (!iban.match(/^[A-Z]{2}[0-9A-Z]{13,30}$/)) {
3838
return undefined;

lib/nip.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ function normalize(nip)
3232
return undefined;
3333
}
3434

35-
nip = nip.replace('-', '').replace(' ', '').trim();
35+
nip = nip.replace(/[ -]/g, '').trim();
3636

3737
if (!nip.match(/^[0-9]{10}$/)) {
3838
return undefined;

lib/nip24client.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ var VATStatus = require('./vatstatus');
4242
var WLStatus = require('./wlstatus');
4343

4444

45-
NIP24Client.prototype.VERSION = '1.2.3';
45+
NIP24Client.prototype.VERSION = '1.2.4';
4646

4747
NIP24Client.prototype.PRODUCTION_URL = 'https://www.nip24.pl/api';
4848
NIP24Client.prototype.TEST_URL = 'https://www.nip24.pl/api-test';

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "nip24client",
3-
"version": "1.2.3",
3+
"version": "1.2.4",
44
"description": "NIP24 Client for Javascript",
55
"keywords": [
66
"nip24",

0 commit comments

Comments
 (0)