MCPcopy Index your code
hub / github.com/callumalpass/tasknotes / getFrontmatterValue

Function getFrontmatterValue

src/ui/taskCardPropertyAccess.ts:204–224  ·  view source on GitHub ↗
(
	taskPath: string,
	key: string,
	context: TaskCardPropertyAccessContext
)

Source from the content-addressed store, hash-verified

202}
203
204function 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}

Callers 2

getTaskCardPropertyValueFunction · 0.70
getUserPropertyValueFunction · 0.70

Calls 2

getCacheMethod · 0.80
warnMethod · 0.80

Tested by

no test coverage detected