( taskPath: string, key: string, context: TaskCardPropertyAccessContext )
| 202 | } |
| 203 | |
| 204 | function getFrontmatterValue( |
| 205 | taskPath: string, |
| 206 | key: string, |
| 207 | context: TaskCardPropertyAccessContext |
| 208 | ): unknown { |
| 209 | try { |
| 210 | const fileMetadata = context.app.metadataCache.getCache(taskPath); |
| 211 | if (!fileMetadata?.frontmatter) { |
| 212 | return undefined; |
| 213 | } |
| 214 | |
| 215 | return fileMetadata.frontmatter[key]; |
| 216 | } catch (error) { |
| 217 | tasknotesLogger.warn(`TaskCard: Error accessing frontmatter for ${taskPath}:`, { |
| 218 | category: "validation", |
| 219 | operation: "taskcard-accessing-frontmatter", |
| 220 | error: error, |
| 221 | }); |
| 222 | return undefined; |
| 223 | } |
| 224 | } |
no test coverage detected