(date: Date | string | null | undefined)
| 35 | * Serializes a date value for JSON responses. |
| 36 | */ |
| 37 | export function serializeDate(date: Date | string | null | undefined): string | null { |
| 38 | if (date === null || date === undefined) return null |
| 39 | if (date instanceof Date) return date.toISOString() |
| 40 | return String(date) |
| 41 | } |
| 42 | |
| 43 | /** |
| 44 | * Formats a KnowledgeBaseWithCounts into the API response shape. |
no outgoing calls
no test coverage detected