From 7807d835f6941cc858c55cd8d41317b4f90f9b3d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rune=20Moskvil=20Lyng=C3=A5s?= Date: Wed, 15 Jun 2022 19:10:51 +0200 Subject: [PATCH] Also support phone numbers starting with `+47` The `+` is removed when data is converted from xml to json --- lib/Visma/repack-visma-data.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/Visma/repack-visma-data.js b/lib/Visma/repack-visma-data.js index 82affc8..22177ad 100644 --- a/lib/Visma/repack-visma-data.js +++ b/lib/Visma/repack-visma-data.js @@ -113,6 +113,9 @@ const repackEmployment = employment => { const repackContactInfo = contactInfo => { const repackPhone = phone => { phone = phone.toString().replace(/ /g, '') + if (phone.length === 10 && phone.startsWith('47')) { + phone = phone.slice(2) + } return phone }