This commit is contained in:
hypercross 2026-03-13 10:55:43 +08:00
parent b2e10d847e
commit 346b97153f
1 changed files with 2 additions and 2 deletions

View File

@ -68,7 +68,7 @@ export async function loadCSV<T = Record<string, string>>(path: string): Promise
if (frontmatter) {
csvResult.frontmatter = frontmatter;
for(const each of result){
Object.setPrototypeOf(each, frontmatter);
Object.assign(each, frontmatter);
}
}
@ -97,5 +97,5 @@ export function processVariables<T extends JSONObject> (body: string, currentRow
return `{{${key}}}`;
}
return body.replace(/\{\{(\w+)\}\}/g, (_, key) => `${replaceProp(key)}`);
return body?.replace(/\{\{(\w+)\}\}/g, (_, key) => `${replaceProp(key)}`) || '';
}