( task: TaskInfo, propertyId: string, context: TaskCardPropertyAccessContext )
| 183 | } |
| 184 | |
| 185 | function 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 | |
| 204 | function getFrontmatterValue( |
| 205 | taskPath: string, |
no test coverage detected