Skip to content

Commit

Permalink
bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
nilskt committed May 26, 2023
1 parent aa6aa0d commit 7aad940
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/repackFreg.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ module.exports = (fregRes, options = {}) => {
const foedselsdato = (fregRes.foedsel.find(ele => ele.erGjeldende))?.foedselsdato
const getAge = birthDate => Math.floor((new Date() - new Date(birthDate).getTime()) / 3.15576e+10)
const alder = getAge(foedselsdato)
const doedsfall = (fregRes.doedsfall?.find(ele => ele.erGjeldende)) ?? null
const doedsfall = fregRes.doedsfall?.erGjeldende ? fregRes.doedsfall : null

const adressebeskyttelse = fregRes.adressebeskyttelse?.filter(ele => ele.erGjeldende).map(ele => ele.graderingsnivaa) ?? []
const bostedsadresse = getAddress(fregRes.bostedsadresse?.find(ele => ele.erGjeldende) ?? null, options)
Expand Down

0 comments on commit 7aad940

Please sign in to comment.