* 获取任务详情
(id: string)
| 331 | options: { omitDescription?: boolean } = {} |
| 332 | ) { |
| 333 | const titlePreview = buildTextPreview(task.title, TASK_TITLE_MAX_LENGTH); |
| 334 | const contentPreview = buildTextPreview(task.description); |
| 335 | const isTruncated = |
| 336 | task.title !== titlePreview |
| 337 | || Boolean(task.description && task.description !== contentPreview); |
| 338 | |
| 339 | const base = { |
| 340 | ...task, |
| 341 | title: titlePreview, |
| 342 | titlePreview, |
| 343 | contentPreview: contentPreview || undefined, |
| 344 | isTruncated, |
| 345 | }; |
| 346 | |
| 347 | if (options.omitDescription) { |
| 348 | const withoutDescription = { ...base }; |
| 349 | delete (withoutDescription as { description?: unknown }).description; |
| 350 | return withoutDescription; |
| 351 | } |
| 352 | |
| 353 | return base; |
| 354 | } |
| 355 | |
| 356 | type ProjectWithStoredGitCapability = { |
| 357 | repoPath: string; |
| 358 | isGitRepo: boolean | null; |
no test coverage detected