( tasks: VaultTask[] )
| 391 | * calendar on its date (#236). Tasks without a due date land in the special |
| 392 | * `'unscheduled'` key. */ |
| 393 | export function bucketTasksByDueDate( |
| 394 | tasks: VaultTask[] |
| 395 | ): Map<string, VaultTask[]> { |
| 396 | const map = new Map<string, VaultTask[]>() |
| 397 | for (const task of tasks) { |
| 398 | if (task.checked) continue |
| 399 | const key = task.due ?? 'unscheduled' |
| 400 | const list = map.get(key) |
| 401 | if (list) list.push(task) |
| 402 | else map.set(key, [task]) |
| 403 | } |
| 404 | return map |
| 405 | } |
no outgoing calls
no test coverage detected