(readHistory?: UserReadHistory[])
| 259 | `; |
| 260 | |
| 261 | export const sumReadHistory = (readHistory?: UserReadHistory[]): number => |
| 262 | readHistory?.reduce((total, entry) => { |
| 263 | const reads = entry?.reads || 0; |
| 264 | |
| 265 | return total + (typeof reads === 'number' && reads >= 0 ? reads : 0); |
| 266 | }, 0) ?? 0; |
| 267 | |
| 268 | export const getProfileReadingWindow = (): { before: Date; after: Date } => { |
| 269 | const before = startOfTomorrow(); |
no outgoing calls
no test coverage detected