( input: TaskEditFrontmatterReadInput )
| 108 | } |
| 109 | |
| 110 | export function readTaskEditFrontmatter( |
| 111 | input: TaskEditFrontmatterReadInput |
| 112 | ): Record<string, unknown> { |
| 113 | try { |
| 114 | const file = input.app.vault.getAbstractFileByPath(input.taskPath); |
| 115 | if (file instanceof TFile) { |
| 116 | return input.app.metadataCache.getFileCache(file)?.frontmatter || {}; |
| 117 | } |
| 118 | } catch (error) { |
| 119 | const logger = input.logger ?? taskEditChangeStateLogger; |
| 120 | logger.warn("Error reading user field frontmatter", { |
| 121 | category: "stale-data", |
| 122 | operation: "task-edit-frontmatter-read", |
| 123 | details: { path: input.taskPath }, |
| 124 | error, |
| 125 | }); |
| 126 | } |
| 127 | |
| 128 | return {}; |
| 129 | } |
no test coverage detected