(
markdown: string,
state: "open" | "closed",
options: { closedAt?: string | null | undefined } = {},
)
| 18465 | } |
| 18466 | |
| 18467 | function markReconciledState( |
| 18468 | markdown: string, |
| 18469 | state: "open" | "closed", |
| 18470 | options: { closedAt?: string | null | undefined } = {}, |
| 18471 | ): string { |
| 18472 | let nextMarkdown = replaceFrontMatterValue(markdown, "current_state", state); |
| 18473 | nextMarkdown = replaceFrontMatterValue(nextMarkdown, "reconciled_at", new Date().toISOString()); |
| 18474 | if (state === "closed" && options.closedAt) { |
| 18475 | nextMarkdown = replaceFrontMatterValue( |
| 18476 | nextMarkdown, |
| 18477 | "current_item_closed_at", |
| 18478 | options.closedAt, |
| 18479 | ); |
| 18480 | } |
| 18481 | if (state === "open") { |
| 18482 | nextMarkdown = replaceFrontMatterValue(nextMarkdown, "review_status", "stale_reopened"); |
| 18483 | nextMarkdown = replaceFrontMatterValue(nextMarkdown, "action_taken", "kept_open"); |
| 18484 | } |
| 18485 | return nextMarkdown; |
| 18486 | } |
| 18487 | |
| 18488 | function moveMarkdownFile(options: { |
| 18489 | sourcePath: string; |
no test coverage detected