( tasks: VaultTask[], dueByPath: ReadonlyMap<string, string> )
| 371 | * nothing changed (cheap to call from a memo). |
| 372 | */ |
| 373 | export function inferDailyTaskDueDates( |
| 374 | tasks: VaultTask[], |
| 375 | dueByPath: ReadonlyMap<string, string> |
| 376 | ): VaultTask[] { |
| 377 | if (dueByPath.size === 0) return tasks |
| 378 | let changed = false |
| 379 | const out = tasks.map((task) => { |
| 380 | if (task.due) return task |
| 381 | const iso = dueByPath.get(task.sourcePath) |
| 382 | if (!iso) return task |
| 383 | changed = true |
| 384 | return { ...task, due: iso, dueInferred: true } |
| 385 | }) |
| 386 | return changed ? out : tasks |
| 387 | } |
| 388 | |
| 389 | /** Bucket tasks by `due` ISO date. Done (checked) tasks are skipped; waiting |
| 390 | * tasks are kept so a `@waiting` task with a due date still appears on the |
no outgoing calls
no test coverage detected