(frontmatter: UnknownRecord, taskType: TaskTypeDefLike | undefined)
| 112 | } |
| 113 | |
| 114 | function applyFieldDefaults(frontmatter: UnknownRecord, taskType: TaskTypeDefLike | undefined): void { |
| 115 | const fields = taskType?.fields; |
| 116 | if (!fields) return; |
| 117 | |
| 118 | for (const [fieldName, fieldDef] of Object.entries(fields)) { |
| 119 | if (fieldDef.default !== undefined && !hasValue(frontmatter[fieldName])) { |
| 120 | frontmatter[fieldName] = fieldDef.default; |
| 121 | } |
| 122 | } |
| 123 | } |
| 124 | |
| 125 | function applyMatchDefaults(frontmatter: UnknownRecord, taskType: TaskTypeDefLike | undefined): void { |
| 126 | const where = taskType?.match?.where; |
no test coverage detected