Function
updateLastPlanBlockStatus
(
blocks: readonly PlanContentBlock[],
status: PlanBlockStatus
)
Source from the content-addressed store, hash-verified
| 85 | } |
| 86 | |
| 87 | export function updateLastPlanBlockStatus( |
| 88 | blocks: readonly PlanContentBlock[], |
| 89 | status: PlanBlockStatus |
| 90 | ): PlanContentBlock[] { |
| 91 | const nextBlocks = blocks.map(toPlanContentBlock) |
| 92 | for (let index = nextBlocks.length - 1; index >= 0; index--) { |
| 93 | if (nextBlocks[index].type === 'plan') { |
| 94 | nextBlocks[index].status = status |
| 95 | break |
| 96 | } |
| 97 | } |
| 98 | return nextBlocks |
| 99 | } |
Tested by
no test coverage detected