MCPcopy Create free account
hub / github.com/dailydotdev/apps / sumReadHistory

Function sumReadHistory

packages/shared/src/graphql/users.ts:261–266  ·  view source on GitHub ↗
(readHistory?: UserReadHistory[])

Source from the content-addressed store, hash-verified

259`;
260
261export 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
268export const getProfileReadingWindow = (): { before: Date; after: Date } => {
269 const before = startOfTomorrow();

Callers 2

ReadingOverviewFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected