/** * Replaces `{key}` placeholders in a copy string with values from `vars`. * Missing keys leave the placeholder intact so broken templates stay visible in UI/tests. */ export const format = (template: string, vars: Record): string => template.replace(/\{(\w+)\}/g, (match, key: string) => { const value = vars[key] return value === undefined || value === null ? match : String(value) })