fix: resolve ts build errors
This commit is contained in:
1 parent
e76d1b899b
commit
0139a77e94
2 files changed
+2
-2
No files matched your search
@@ -30,6 +30,6 @@ export function applyTemplate(str: string | undefined, ctx: TemplateContext) {
|
||||
if (!str) return "";
|
||||
return str.replace(/{{\s*(\w+)\s*}}/g, (_, key) => {
|
||||
const value = ctx[key as keyof TemplateContext];
|
||||
return value ?? "";
|
||||
return value == null ? "" : String(value);
|
||||
});
|
||||
}
|
||||
Reference in new issue
Block a user