Correction du script de compression des taux de versemenent transport

pull/287/head
Mael 2018-07-25 10:01:02 +00:00
parent ae9eb33f11
commit 5207447c68
1 changed files with 6 additions and 0 deletions

View File

@ -7,6 +7,7 @@
let taux = require('./taux-versement-transport-bruts.json')
let {
sort,
filter,
head,
pipe,
map,
@ -65,6 +66,11 @@ let additionnalResults = villesAvecArrondissements.map(
let extractLastTaux = pipe(
toPairs,
sort(([date1], [date2]) => (date1 > date2 ? -1 : 1)),
filter(
([date]) =>
console.log(date, new Date(date) <= Date.now()) ||
new Date(date) <= Date.now()
),
head,
([, rate]) => rate
)