From 17e754b8af3e8dcf4c4456041cf54a9073c3e1ca Mon Sep 17 00:00:00 2001 From: Matthieu Lemoine <8517072+MatthieuLemoine@users.noreply.github.com> Date: Wed, 30 Aug 2023 16:45:05 +0200 Subject: [PATCH 1/2] fix(isVAT): fixed KZ VAT number length check --- src/lib/isVAT.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/isVAT.js b/src/lib/isVAT.js index ece7d8560..a8e2611b6 100644 --- a/src/lib/isVAT.js +++ b/src/lib/isVAT.js @@ -75,7 +75,7 @@ export const vatMatchers = { IN: str => /^(IN)?\d{15}$/.test(str), ID: str => /^(ID)?(\d{15}|(\d{2}.\d{3}.\d{3}.\d{1}-\d{3}.\d{3}))$/.test(str), IL: str => /^(IL)?\d{9}$/.test(str), - KZ: str => /^(KZ)?\d{9}$/.test(str), + KZ: str => /^(KZ)?\d{12}$/.test(str), NZ: str => /^(NZ)?\d{9}$/.test(str), NG: str => /^(NG)?(\d{12}|(\d{8}-\d{4}))$/.test(str), NO: str => /^(NO)?\d{9}MVA$/.test(str), From 6fa00af100e6c49741dbac8379ec135e60836eb5 Mon Sep 17 00:00:00 2001 From: Matthieu Lemoine <8517072+MatthieuLemoine@users.noreply.github.com> Date: Wed, 30 Aug 2023 16:48:07 +0200 Subject: [PATCH 2/2] fix(isVAT): fixed KZ VAT number length test --- test/validators.test.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/validators.test.js b/test/validators.test.js index 6c68cd71a..ae79d97c4 100644 --- a/test/validators.test.js +++ b/test/validators.test.js @@ -14022,11 +14022,11 @@ describe('Validators', () => { validator: 'isVAT', args: ['KZ'], valid: [ - 'KZ123456789', - '123456789', + 'KZ123456789012', + '123456789012', ], invalid: [ - 'KZ 123456789', + 'KZ 123456789012', '12345678', ], });