* Simple helper to replace {{var}} placeholders in a string
(template: string, vars: Record<string, any>)
| 53 | * Simple helper to replace {{var}} placeholders in a string |
| 54 | */ |
| 55 | function interpolate(template: string, vars: Record<string, any>): string { |
| 56 | return template.replace(/\{\{\s*(\w+)\s*\}\}/g, (match, key) => { |
| 57 | return vars[key] !== undefined ? String(vars[key]) : match; |
| 58 | }); |
| 59 | } |
| 60 | |
| 61 | const mapTypeToSchema = ( |
| 62 | type: string, |