Skip to content

Commit

Permalink
Update to use lodash for readability
Browse files Browse the repository at this point in the history
  • Loading branch information
ThomasG77 committed Feb 18, 2022
1 parent 27eb907 commit 214a186
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions build/codes-postaux.js
@@ -1,12 +1,12 @@
const {groupBy, chain} = require('lodash')
const {groupBy, chain, uniq} = require('lodash')
const codesPostaux = require('./../sources/codes-postaux-with-fix.json')
const {MLP_CODES} = require('./mlp')

const codesPostauxIndex = groupBy(codesPostaux, 'codeCommune')

function getCodesPostaux(codeCommune) {
if (codeCommune in codesPostauxIndex) {
return Array.from(new Set(codesPostauxIndex[codeCommune].map(i => i.codePostal)))
return uniq(codesPostauxIndex[codeCommune].map(i => i.codePostal))
}

return []
Expand Down

0 comments on commit 214a186

Please sign in to comment.