MCPcopy Create free account
hub / github.com/callumalpass/tasknotes / getUserPropertyValue

Function getUserPropertyValue

src/ui/taskCardPropertyAccess.ts:185–202  ·  view source on GitHub ↗
(
	task: TaskInfo,
	propertyId: string,
	context: TaskCardPropertyAccessContext
)

Source from the content-addressed store, hash-verified

183}
184
185function getUserPropertyValue(
186 task: TaskInfo,
187 propertyId: string,
188 context: TaskCardPropertyAccessContext
189): unknown {
190 const fieldId = propertyId.slice(5);
191 const userField = context.settings.userFields?.find((field) => field.id === fieldId);
192 if (!userField?.key) {
193 return null;
194 }
195
196 let value = (task as unknown as Record<string, unknown>)[userField.key];
197 if (value === undefined) {
198 value = getFrontmatterValue(task.path, userField.key, context);
199 }
200
201 return value;
202}
203
204function getFrontmatterValue(
205 taskPath: string,

Callers 1

getTaskCardPropertyValueFunction · 0.85

Calls 1

getFrontmatterValueFunction · 0.70

Tested by

no test coverage detected