0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-17 23:44:39 -05:00

Fixed mergeDates zero and one item in list (#2360)

The exit clause of the mergeDates function should return an array rather
than an object, to ensure that an array is always returned. Because we
are using the concat method when recursing, this continues to work for
longer lists.

We want to return an empty array if list is empty, this protects against
returning [undefined]
This commit is contained in:
Fabien 'egg' O'Carroll 2022-05-03 12:01:23 +01:00 committed by GitHub
parent c2102477a7
commit 94ae33858d

View file

@ -376,7 +376,7 @@ export default class DashboardStatsService extends Service {
const [current, ...rest] = list;
if (!current) {
return entry;
return entry ? [entry] : [];
}
if (!entry) {