fix: bug
This commit is contained in:
parent
b2e10d847e
commit
346b97153f
|
|
@ -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)}`) || '';
|
||||
}
|
||||
Loading…
Reference in New Issue