Skip to content

Commit

Permalink
Lint file not concerned directly with PR to make linting check happy
Browse files Browse the repository at this point in the history
  • Loading branch information
ThomasG77 committed Aug 31, 2022
1 parent 1fa722d commit 37a31dc
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions build/collectivites-outremer.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
const {readCsvFile} = require('./util')

const chefLieuCOM = {
'975': '97502',
'977': '97701',
'978': '97801',
'984': '97502',
'986': '98613',
'987': '98735',
'988': '98818',
'989': '98901'
975: '97502',
977: '97701',
978: '97801',
984: '97502',
986: '98613',
987: '98735',
988: '98818',
989: '98901'
}

async function extractCommunesCOM(path) {
Expand Down Expand Up @@ -45,7 +45,7 @@ async function generateDepartementsAndRegionsCOM(path) {

const departements = Object.values(rows.reduce((acc, curr) => {
if (!(curr.code_collectivite in acc)) {
acc[curr.code_collectivite] = {
acc[curr.code_collectivite] = {
code: curr.code_collectivite,
region: curr.code_collectivite,
chefLieu: chefLieuCOM[curr.code_collectivite],
Expand All @@ -54,13 +54,15 @@ async function generateDepartementsAndRegionsCOM(path) {
zone: 'com'
}
}

return acc
}, {}))

const regions = JSON.parse(JSON.stringify(departements)).map(el => {
delete el.region
return el
});
})

return [departements, regions]
}

Expand Down

0 comments on commit 37a31dc

Please sign in to comment.