( templates: Record<string, PromptTemplate> | undefined, )
| 197 | * @returns |
| 198 | */ |
| 199 | export function serializePromptTemplates( |
| 200 | templates: Record<string, PromptTemplate> | undefined, |
| 201 | ): Record<string, string> | undefined { |
| 202 | if (!templates) return undefined; |
| 203 | |
| 204 | return Object.fromEntries( |
| 205 | Object.entries(templates).map(([key, template]) => { |
| 206 | const serialized = typeof template === "function" ? "" : template; |
| 207 | return [key, serialized]; |
| 208 | }), |
| 209 | ); |
| 210 | } |
no outgoing calls
no test coverage detected