Files
Agent-Workbench/docs/desktop-host-f-accepted-source/114-summary.ts
T
2026-10-31 13:10:39 +08:00

5 lines
266 B
TypeScript

import type { Task } from './types.ts';
export function summarizeTasks(tasks: Task[]) {
return { total: tasks.length, completed: tasks.filter(task => task.done).length, pendingHours: tasks.filter(task => !task.done).reduce((sum, task) => sum + task.hours, 0) };
}