fix: applyTemplate用??替代||避免空字符串被回退为占位符
This commit is contained in:
@@ -92,7 +92,7 @@ export function notifyInfo(title: string, detail: string): void {
|
||||
}
|
||||
|
||||
function applyTemplate(template: string, vars: Record<string, string>): string {
|
||||
return template.replace(/\{([^}]+)\}/g, (_, key) => vars[key] || '{' + key + '}');
|
||||
return template.replace(/\{([^}]+)\}/g, (_, key) => vars[key] ?? '{' + key + '}');
|
||||
}
|
||||
|
||||
function getEventTemplates(): Record<string, { title?: string; content: string }> {
|
||||
|
||||
Reference in New Issue
Block a user