From 11ac6a4e5cafb1622a5199da0825a661cd689328 Mon Sep 17 00:00:00 2001 From: Matthieu Lemoine <8517072+MatthieuLemoine@users.noreply.github.com> Date: Sat, 27 Apr 2024 16:07:39 +0200 Subject: [PATCH] fix(isVAT): fixed KZ VAT number length check (#2279) * fix(isVAT): fixed KZ VAT number length check * fix(isVAT): fixed KZ VAT number length test --- src/lib/isVAT.js | 2 +- test/validators.test.js | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) 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), diff --git a/test/validators.test.js b/test/validators.test.js index a2942f32c..049a16708 100644 --- a/test/validators.test.js +++ b/test/validators.test.js @@ -14175,11 +14175,11 @@ describe('Validators', () => { validator: 'isVAT', args: ['KZ'], valid: [ - 'KZ123456789', - '123456789', + 'KZ123456789012', + '123456789012', ], invalid: [ - 'KZ 123456789', + 'KZ 123456789012', '12345678', ], });