MCPcopy
hub / github.com/callumalpass/tasknotes / readTaskEditFrontmatter

Function readTaskEditFrontmatter

src/modals/taskEditChangeState.ts:110–129  ·  view source on GitHub ↗
(
	input: TaskEditFrontmatterReadInput
)

Source from the content-addressed store, hash-verified

108}
109
110export 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}

Calls 3

getAbstractFileByPathMethod · 0.80
getFileCacheMethod · 0.80
warnMethod · 0.80

Tested by

no test coverage detected