( allTasks: readonly T[], selectedSubtaskFiles: readonly PathLike[], currentTaskPath?: string )
| 17 | } |
| 18 | |
| 19 | export function getTaskModalSubtaskCandidates<T extends Pick<TaskInfo, "path">>( |
| 20 | allTasks: readonly T[], |
| 21 | selectedSubtaskFiles: readonly PathLike[], |
| 22 | currentTaskPath?: string |
| 23 | ): T[] { |
| 24 | const selectedPaths = new Set(selectedSubtaskFiles.map((file) => file.path)); |
| 25 | return allTasks.filter((candidate) => { |
| 26 | if (currentTaskPath && candidate.path === currentTaskPath) return false; |
| 27 | return !selectedPaths.has(candidate.path); |
| 28 | }); |
| 29 | } |
| 30 | |
| 31 | export function addTaskModalSubtaskFile<T extends PathLike>( |
| 32 | selectedSubtaskFiles: readonly T[], |
no test coverage detected