( userFields: Record<string, unknown> )
| 40 | } |
| 41 | |
| 42 | export function buildCustomFrontmatter( |
| 43 | userFields: Record<string, unknown> |
| 44 | ): Record<string, unknown> { |
| 45 | const customFrontmatter: Record<string, unknown> = {}; |
| 46 | |
| 47 | for (const [fieldKey, fieldValue] of Object.entries(userFields)) { |
| 48 | if (fieldValue !== null && fieldValue !== undefined && fieldValue !== "") { |
| 49 | customFrontmatter[fieldKey] = fieldValue; |
| 50 | } |
| 51 | } |
| 52 | |
| 53 | return customFrontmatter; |
| 54 | } |
| 55 | |
| 56 | export function getUserFieldChanges( |
| 57 | userFields: Record<string, unknown>, |
no outgoing calls
no test coverage detected