File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -118,6 +118,9 @@ export default {
118118 const isPlural = (name , total , s ) => {
119119 return ` <span class="${ name} ">${ total} </span> ${ s}${ (total > 1 ) ? ' s' : ' ' } `
120120 }
121+ const isContinue = (a , b ) => {
122+ return a && b ? ' , ' : a && ! b ? ' and ' : ' '
123+ }
121124 const perDayConfirmed = this .getPerDay (Object .entries (this .result .timelines .confirmed .timeline ))
122125 const perDayDeaths = this .getPerDay (Object .entries (this .result .timelines .deaths .timeline ))
123126 const perDayRecovered = this .getPerDay (Object .entries (this .result .timelines .recovered .timeline ))
@@ -128,11 +131,11 @@ export default {
128131 summary += ` ${ isPlural (' confirmed' , o[1 ], ' confirmed case' )} `
129132 }
130133 if (perDayDeaths[o[0 ]]) {
131- summary += o[1 ] ? ' and ' : ' '
134+ summary += isContinue ( o[1 ], perDayRecovered[o[ 0 ]])
132135 summary += ` ${ isPlural (' deaths' , perDayDeaths[o[0 ]], ' death' )} `
133136 }
134137 if (perDayRecovered[o[0 ]]) {
135- summary += ! o[1 ] || ! perDayDeaths[o[0 ]] ? ' ' : ' and '
138+ summary += isContinue ( o[1 ], perDayDeaths[o[0 ]])
136139 summary += ` <span class="recovered">${ perDayRecovered[o[0 ]]} </span> recovered`
137140 }
138141 }
You can’t perform that action at this time.
0 commit comments