Skip to content

Commit

Permalink
Also support phone numbers starting with +47
Browse files Browse the repository at this point in the history
The `+` is removed when data is converted from xml to json
  • Loading branch information
runely committed Jun 15, 2022
1 parent e44114c commit 7807d83
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/Visma/repack-visma-data.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit 7807d83

Please sign in to comment.