bugfix difi + ssb data merge

This commit is contained in:
Nils Norman Haukås 2017-07-13 23:04:19 +02:00
parent 73e03d193e
commit b9fc9fd532

View file

@ -26,7 +26,8 @@ export const municipalities: Municipality[] = SSBMunicipalities.reduce(
function getDifiData(muni: Municipality) {
let result = {}
DifiMunicipalities.map(difiMuni => {
if (difiMuni.title.toLowerCase().indexOf(muni.name.toLowerCase()) !== -1) {
const trimmedTitle = difiMuni.title.replace(/kommune/gi, '').trim()
if (trimmedTitle.toLowerCase() === muni.name.toLowerCase()) {
result = difiMuni
}
})