( streak: Pick<UserStreak, 'lastViewAt' | 'current'> | undefined | null, timezone?: string, expectedCurrent?: number, now: Date = new Date(), )
| 18 | // too: when the API's grace window credits an early-morning read to |
| 19 | // yesterday, lastViewAt lands on yesterday and never looks like today. |
| 20 | export const includesThisRead = ( |
| 21 | streak: Pick<UserStreak, 'lastViewAt' | 'current'> | undefined | null, |
| 22 | timezone?: string, |
| 23 | expectedCurrent?: number, |
| 24 | now: Date = new Date(), |
| 25 | ): boolean => |
| 26 | hasStreakViewToday(streak, timezone, now) || |
| 27 | (expectedCurrent !== undefined && streak?.current === expectedCurrent); |
no test coverage detected